diff options
| author | Li Jin <dragon-fly@qq.com> | 2026-01-22 15:03:12 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2026-01-22 15:03:12 +0800 |
| commit | f1454bbbd13a71da2005ff789cde2da0e9eb81f6 (patch) | |
| tree | 37131187f4218dd3ebec049101c28a161e7ca289 /spec/outputs/test/pipe_spec.lua | |
| parent | 604a8e5e53cdc7391a502fcabf07e8f1cc2a778c (diff) | |
| download | yuescript-main.tar.gz yuescript-main.tar.bz2 yuescript-main.zip | |
Diffstat (limited to '')
| -rw-r--r-- | spec/outputs/test/pipe_spec.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/outputs/test/pipe_spec.lua b/spec/outputs/test/pipe_spec.lua new file mode 100644 index 0000000..3d797ed --- /dev/null +++ b/spec/outputs/test/pipe_spec.lua | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | return describe("pipe", function() | ||
| 2 | return it("pipes through functions", function() | ||
| 3 | local f | ||
| 4 | f = function(x) | ||
| 5 | return x + 1 | ||
| 6 | end | ||
| 7 | local g | ||
| 8 | g = function(x) | ||
| 9 | return x * 2 | ||
| 10 | end | ||
| 11 | return assert.same((g(f(3))), 8) | ||
| 12 | end) | ||
| 13 | end) | ||
