From 8ee1667a9a38d56abd612697b39b932fefce9a16 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 2 Aug 2023 10:57:28 +0300 Subject: [PATCH] tools: fix exiting the v repl, after just Enter (regression happened in bf00ac6) --- cmd/tools/vrepl.v | 2 +- .../slow_tests/repl/newlines_should_not_exit_the_repl.repl | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 vlib/v/slow_tests/repl/newlines_should_not_exit_the_repl.repl diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index 204c01395..f2d737dc2 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -312,7 +312,7 @@ fn run_repl(workdir string, vrepl_prefix string) int { if line == '' && oline.ends_with('\n') { continue } - if line.len <= -1 || line == '' || line == 'exit' { + if line.len <= -1 || line == 'exit' { break } if exit_pos := line.index('exit') { diff --git a/vlib/v/slow_tests/repl/newlines_should_not_exit_the_repl.repl b/vlib/v/slow_tests/repl/newlines_should_not_exit_the_repl.repl new file mode 100644 index 000000000..cbc3b3ed8 --- /dev/null +++ b/vlib/v/slow_tests/repl/newlines_should_not_exit_the_repl.repl @@ -0,0 +1,6 @@ + + + +println('hi') +===output=== +hi -- 2.39.5