From b1d0a3540bac162914f3fd77d2fc82b344125036 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 31 Jan 2020 23:36:15 +0800 Subject: add pipe pair tests --- tests/modules/pipe/pipe_pair.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/modules/pipe/pipe_pair.lua (limited to 'tests/modules/pipe/pipe_pair.lua') diff --git a/tests/modules/pipe/pipe_pair.lua b/tests/modules/pipe/pipe_pair.lua new file mode 100644 index 000000000..de81a3133 --- /dev/null +++ b/tests/modules/pipe/pipe_pair.lua @@ -0,0 +1,12 @@ +import("core.base.pipe") + +function main() + local rpipe, wpipe = pipe.openpair(4096) + wpipe:write("hello xmake!", {block = true}) + local read, data = rpipe:read(13) + if read > 0 and data then + data:dump() + end + rpipe:close() + wpipe:close() +end -- cgit v1.3.1