From 41efe545f273500c6655a3ef5c52384caf923416 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 18 Aug 2019 22:06:39 +0300 Subject: [PATCH] repl_test: remove dependance on echo, use stdin redirection instead. --- compiler/tests/repl/repl_test.v | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/tests/repl/repl_test.v b/compiler/tests/repl/repl_test.v index 358b39b6b0..00fb5e7b15 100644 --- a/compiler/tests/repl/repl_test.v +++ b/compiler/tests/repl/repl_test.v @@ -8,9 +8,14 @@ fn test_repl() { assert false break } - input := content.all_before('===output===\n').replace('$', '\\$') + input_temporary_filename := 'input_temporary_filename.txt' + input := content.all_before('===output===\n') output := content.all_after('===output===\n') - r := os.exec('echo "$input" | ./v') or { + os.write_file(input_temporary_filename, input) + defer { + os.rm(input_temporary_filename) + } + r := os.exec('./v < $input_temporary_filename') or { assert false break }