diff --git a/test/lua/pipe.in b/test/lua/pipe.in new file mode 100644 index 000000000..191028156 --- /dev/null +++ b/test/lua/pipe.in @@ -0,0 +1 @@ +foo \ No newline at end of file diff --git a/test/lua/pipe.lua b/test/lua/pipe.lua new file mode 100644 index 000000000..7b6c80877 --- /dev/null +++ b/test/lua/pipe.lua @@ -0,0 +1,24 @@ +require 'busted.runner'() + +local file = vis.win.file + +describe("vis.pipe", function() + + it("vis.pipe buffer", function() + vis:pipe("foo", "cat > f") + local f = io.open("f", "r") + assert.truthy(f) + assert.are.equal(f:read("*a"), "foo") + f:close() + os.remove("f") + end) + + it("vis.pipe range", function() + vis:pipe(file, {start=0, finish=3}, "cat > f") + local f = io.open("f", "r") + assert.truthy(f) + assert.are.equal(f:read("*a"), "foo") + f:close() + os.remove("f") + end) +end)