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.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/util_iterators_spec.lua b/spec/util_iterators_spec.lua
new file mode 100644
index 00000000..63835b12
--- /dev/null
+++ b/spec/util_iterators_spec.lua
@@ -0,0 +1,15 @@
+local iter = require "util.iterators";
+local set = require "util.set";
+
+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);