summaryrefslogtreecommitdiff
path: root/lib/elixir/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@dashbit.co>2023-01-09 10:59:03 +0100
committerGitHub <noreply@github.com>2023-01-09 10:59:03 +0100
commit6b7e99e50fdf19f5ec656383e3e539a393ea7bb4 (patch)
treeb8f5e7e43c93ff9a18249c4220cd8cdd9268b61b /lib/elixir/test
parent801435064527a89ad6a62d0bc16ef53670b067c9 (diff)
downloadelixir-6b7e99e50fdf19f5ec656383e3e539a393ea7bb4.tar.gz
Support :lines in System.cmd/3 (#12323)
Diffstat (limited to 'lib/elixir/test')
-rw-r--r--lib/elixir/test/elixir/system_test.exs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/elixir/test/elixir/system_test.exs b/lib/elixir/test/elixir/system_test.exs
index 5322a8703..6f8c57b07 100644
--- a/lib/elixir/test/elixir/system_test.exs
+++ b/lib/elixir/test/elixir/system_test.exs
@@ -173,6 +173,14 @@ defmodule SystemTest do
assert {["hello\n"], 0} = System.cmd("echo", ["hello"], opts)
end
+ test "cmd/3 by line" do
+ assert {["hello", "world"], 0} =
+ System.cmd("echo", ["hello\nworld"], into: [], lines: 1024)
+
+ assert {["hello", "world"], 0} =
+ System.cmd("echo", ["-n", "hello\nworld"], into: [], lines: 3)
+ end
+
@echo "echo-elixir-test"
@tag :tmp_dir
test "cmd/3 with absolute and relative paths", config do