diff options
Diffstat (limited to 'module-test')
| -rw-r--r-- | module-test/argument_printer.cc | 2 | ||||
| -rw-r--r-- | module-test/lexer_test.cc | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/module-test/argument_printer.cc b/module-test/argument_printer.cc index 8b8c6c3..4c23ff2 100644 --- a/module-test/argument_printer.cc +++ b/module-test/argument_printer.cc @@ -1,5 +1,5 @@ // print all arguments -// $ g++ module-test/argument_printer.cc -std=c++23 +// $ g++ module-test/argument_printer.cc -std=c++23 -o module-test/argument_printer.out #include <iostream> diff --git a/module-test/lexer_test.cc b/module-test/lexer_test.cc index 20e9556..cbc55d7 100644 --- a/module-test/lexer_test.cc +++ b/module-test/lexer_test.cc @@ -6,6 +6,7 @@ g++ \ src/lexer/token.cc \ src/lexer/ast.cc \ src/lexer/symbol_property.cc \ + src/util/string.cc \ -std=c++23 -Iinclude -Ithird_party/magic_enum/include \ -O0 -ggdb3 -fno-omit-frame-pointer -fno-inline -D_GLIBCXX_ASSERTIONS \ -o module-test/lexer_test.out @@ -27,6 +28,7 @@ g++ \ #include "lexer/token.h" #include "global.h" #include "error.h" +#include "util/string.h" using namespace std; using namespace ov4; @@ -37,7 +39,7 @@ constexpr int MAXLINE = 1024; int main() { verbose = true; - int test_case = 17; + int test_case = 19; string s; switch (test_case) @@ -126,6 +128,16 @@ int main() s = "((alpha)"; break; + // quotation mark in command + case 18: + s = "argument_printer.out \"hello hi\" second third &"; + break; + + // harder quotation mark test + case 19: + s = "alpha \"arg1 arg2 \'arg3 arg4\' arg5\" && beta &"; + break; + default: return 0; } |
