repl_test: remove dependance on echo, use stdin redirection instead.

pull/1668/head
Delyan Angelov 2019-08-18 22:06:39 +03:00 committed by Alexander Medvednikov
parent e1d2c83ff6
commit 41efe545f2
1 changed files with 7 additions and 2 deletions

View File

@ -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
}