aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_iterators_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util_iterators_spec.lua')
-rw-r--r--spec/util_iterators_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/util_iterators_spec.lua b/spec/util_iterators_spec.lua
new file mode 100644
index 00000000..d00058f4
--- /dev/null
+++ b/spec/util_iterators_spec.lua
@@ -0,0 +1,14 @@
+local iter = require "util.iterators";
+
+describe("util.iterators", function ()
+ describe("join", function ()
+ it("should produce a joined iterator", function ()
+ local expect = { "a", "b", "c", 1, 2, 3 };
+ local output = {};
+ for x in iter.join(iter.values({"a", "b", "c"})):append(iter.values({1, 2, 3})) do
+ table.insert(output, x);
+ end
+ assert.same(output, expect);
+ end);
+ end);
+end);