From a40a8e1b8a0a2298db9b27c052f4fd5d0178eb6c Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 25 Mar 2024 03:14:12 +0700 Subject: lib/bytes: add test for Parser Read and ReadNoSpace The test initialize Parser with seven delimiters, '\t', '=', '\n', ' ', '"', '(', and ')' and then Read token from multi lines contents. --- lib/bytes/testdata/Parser_ReadNoSpace_test.txt | 37 +++++++++++++++++++ lib/bytes/testdata/Parser_Read_test.txt | 50 ++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 lib/bytes/testdata/Parser_ReadNoSpace_test.txt create mode 100644 lib/bytes/testdata/Parser_Read_test.txt (limited to 'lib/bytes/testdata') diff --git a/lib/bytes/testdata/Parser_ReadNoSpace_test.txt b/lib/bytes/testdata/Parser_ReadNoSpace_test.txt new file mode 100644 index 00000000..e18fd125 --- /dev/null +++ b/lib/bytes/testdata/Parser_ReadNoSpace_test.txt @@ -0,0 +1,37 @@ +The test initialize Parser with seven delimiters. + +>>> multiline:delims + = + "() + +>>> multiline +a b = c ( + d e = f + g + ) +h=i ( + j="k l m" +) + +<<< multiline:ReadNoSpace +"a" ' ' +"b" ' ' +"" '=' +"c" ' ' +"" '(' +"d" ' ' +"e" ' ' +"" '=' +"f" '\n' +"g" '\n' +"" ')' +"h" '=' +"i" ' ' +"" '(' +"j" '=' +"" '"' +"k" ' ' +"l" ' ' +"m" '"' +"" ')' +"" '\x00' diff --git a/lib/bytes/testdata/Parser_Read_test.txt b/lib/bytes/testdata/Parser_Read_test.txt new file mode 100644 index 00000000..235c9730 --- /dev/null +++ b/lib/bytes/testdata/Parser_Read_test.txt @@ -0,0 +1,50 @@ +The test initialize Parser with seven delimiters. + +>>> multiline:delims + = + "() + +>>> multiline +a b = c ( + d e = f + g + ) +h=i ( + j="k l m" +) + +<<< multiline:Read +"a" ' ' +"b" ' ' +"" '=' +"" ' ' +"c" ' ' +"" '(' +"" '\n' +"" ' ' +"" ' ' +"d" ' ' +"e" ' ' +"" '=' +"" ' ' +"f" '\n' +"" ' ' +"" ' ' +"g" '\n' +"" ' ' +"" ' ' +"" ')' +"" '\n' +"h" '=' +"i" ' ' +"" '(' +"" '\n' +"" ' ' +"j" '=' +"" '"' +"k" ' ' +"l" ' ' +"m" '"' +"" '\n' +"" ')' +"" '\x00' -- cgit v1.3-5-g9baa