diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-25 03:14:12 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-25 03:14:12 +0700 |
| commit | a40a8e1b8a0a2298db9b27c052f4fd5d0178eb6c (patch) | |
| tree | bd2ba25bdc711f12d75cc03a03dd1d7faa29b116 /lib/bytes/testdata | |
| parent | a78ff8d36f11acc5a65b22f2aa72557b9667f23f (diff) | |
| download | pakakeh.go-a40a8e1b8a0a2298db9b27c052f4fd5d0178eb6c.tar.xz | |
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.
Diffstat (limited to 'lib/bytes/testdata')
| -rw-r--r-- | lib/bytes/testdata/Parser_ReadNoSpace_test.txt | 37 | ||||
| -rw-r--r-- | lib/bytes/testdata/Parser_Read_test.txt | 50 |
2 files changed, 87 insertions, 0 deletions
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' |
