summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/modules/pipe/pipe_pair.lua12
1 files changed, 12 insertions, 0 deletions
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