Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Yonaba/Moses.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorYonaba <roland.yonaba@gmail.com>2017-04-27 17:39:45 +0300
committerYonaba <roland.yonaba@gmail.com>2017-04-27 17:39:45 +0300
commit9ac95851035747848657c2fda341220481fe1edb (patch)
tree8baf0f639e74cd35d1a866870c71d0a86906b62d /spec
parent997ec36d8ac9f7167f1b0e69ec308536769e2f2b (diff)
Added _.clear
Diffstat (limited to 'spec')
-rw-r--r--spec/table_spec.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/table_spec.lua b/spec/table_spec.lua
index 54c6c96..209969a 100644
--- a/spec/table_spec.lua
+++ b/spec/table_spec.lua
@@ -3,7 +3,17 @@ local _ = require 'moses'
context('Table functions specs', function()
- context('each', function()
+ context('clear', function()
+
+ test('', function()
+ local t = _.clear({'a', true, 'hello'})
+ assert_true(_.isEqual(t,{}))
+ assert_nil(next(t))
+ end)
+
+ end)
+
+ context('each', function()
test('provides values and iteration count ', function()
local t = {1,2,3}