From e33f6053d72711cf75c3b30c811fd2a99d6ca7d8 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 9 Sep 2025 14:31:32 -0400 Subject: Add list test --- tests/interpretation/README.md | 2 +- tests/interpretation/list.pom | 27 +++++++++++++++++++++++++++ tests/parsing/escape_sequences.flat.pom | 1 + tests/parsing/escape_sequences.pom | 1 + 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/interpretation/list.pom diff --git a/tests/interpretation/README.md b/tests/interpretation/README.md index b263e05..136142b 100644 --- a/tests/interpretation/README.md +++ b/tests/interpretation/README.md @@ -10,5 +10,5 @@ return an error. `list.pom` — The keys in this file are in pairs `k.list` and `k.sep`. `k.list` is a POM list, and `k.sep` is the concatenation of `x;` for each entry -`x` in the list (none of the entries have `;` in them, so this representation is +`x` in the list with no leading/trailing whitespace (none of the entries have `;` in them, so this representation is unambiguous). diff --git a/tests/interpretation/list.pom b/tests/interpretation/list.pom new file mode 100644 index 0000000..f02fa23 --- /dev/null +++ b/tests/interpretation/list.pom @@ -0,0 +1,27 @@ +# examples from spec +fonts.list = monospace, sans-serif, serif +fonts.sep = monospace;sans-serif;serif; +files.list = " foo.txt, weird\,name,z " +files.sep = foo.txt;weird,name;z; +things.list = \,,,76 +things.sep = ,;;76; +empties.list = ,,, +empties.sep = ;;; +escapees.list = \\,\a,\, +escapees.sep = \;\a;,; + + +empty.list = +empty.sep = +a.list = a +a.sep = a; +ab.list = " a , b " +ab.sep = a;b; +1empty.list = , +1empty.sep = ; +2empty.list = ,, +2empty.sep = ;; +comma.list = a\,b, c +comma.sep = a,b;c; +backslash.list = a\\\,b, c\\d +backslash.sep = a\,b;c\d; diff --git a/tests/parsing/escape_sequences.flat.pom b/tests/parsing/escape_sequences.flat.pom index e124d91..2df0a4c 100644 --- a/tests/parsing/escape_sequences.flat.pom +++ b/tests/parsing/escape_sequences.flat.pom @@ -1,3 +1,4 @@ qvalue = "\x0a\x0d\x09\x5c\x22\x27\x60\\,\\☺☺☺\x60\x27" bvalue = "\x0a\x0d\x09\x5c\x22\x27\x60\\,\\☺☺☺\x22\x27" nvalue = "\\n\\r\\t\\u\\x\\," +unquoted_escape = "\\`foo\\`" diff --git a/tests/parsing/escape_sequences.pom b/tests/parsing/escape_sequences.pom index 959c97c..149fb69 100644 --- a/tests/parsing/escape_sequences.pom +++ b/tests/parsing/escape_sequences.pom @@ -1,3 +1,4 @@ qvalue = "\n\r\t\\\"\'\`\,\x5c\u{263a}\u{0263a}\u{00263A}`'" bvalue = `\n\r\t\\\"\'\`\,\x5c\u{263a}\u{0263a}\u{00263A}"'` nvalue = \n\r\t\u\x\, +unquoted_escape = \`foo\` -- cgit v1.2.3