summaryrefslogtreecommitdiff
path: root/tests/parsing
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parsing')
-rw-r--r--tests/parsing/README.md3
-rw-r--r--tests/parsing/escape_sequences.flat.pom3
-rw-r--r--tests/parsing/escape_sequences.pom3
-rw-r--r--tests/parsing/strange_keys.flat.pom18
-rw-r--r--tests/parsing/strange_keys.pom26
-rw-r--r--tests/parsing/value_and_subkeys.flat.pom4
-rw-r--r--tests/parsing/value_and_subkeys.pom5
7 files changed, 60 insertions, 2 deletions
diff --git a/tests/parsing/README.md b/tests/parsing/README.md
index d3389cf..2279c04 100644
--- a/tests/parsing/README.md
+++ b/tests/parsing/README.md
@@ -1,7 +1,6 @@
# Parsing tests
-These tests only check that key-value pairs are parsed correctly.
-They do not test merging, number/list parsing, or schema validation.
+These tests are for checking that key-value pairs are parsed correctly.
Each test `x` consists of two files, `x.pom` and `x.flat.pom`. These
files should produce the exact same schema, but `x.flat.pom` is formatted
diff --git a/tests/parsing/escape_sequences.flat.pom b/tests/parsing/escape_sequences.flat.pom
new file mode 100644
index 0000000..e124d91
--- /dev/null
+++ b/tests/parsing/escape_sequences.flat.pom
@@ -0,0 +1,3 @@
+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\\,"
diff --git a/tests/parsing/escape_sequences.pom b/tests/parsing/escape_sequences.pom
new file mode 100644
index 0000000..959c97c
--- /dev/null
+++ b/tests/parsing/escape_sequences.pom
@@ -0,0 +1,3 @@
+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\,
diff --git a/tests/parsing/strange_keys.flat.pom b/tests/parsing/strange_keys.flat.pom
new file mode 100644
index 0000000..0bdc87c
--- /dev/null
+++ b/tests/parsing/strange_keys.flat.pom
@@ -0,0 +1,18 @@
+- = "0"
+* = "1"
+**-** = "2"
+/ = "3"
+9.9 = "4"
+-2 = "5"
+7 = "6"
+_ = "7"
+__ = "8"
+œ = "9"
+̀ = "10"
+ = "11"
+􂍅 = "12"
+  = "13"
+̀.􂍅 = "14"
+*.* = "15"
+-.- = "16"
+0.0 = "17"
diff --git a/tests/parsing/strange_keys.pom b/tests/parsing/strange_keys.pom
new file mode 100644
index 0000000..a0e2cae
--- /dev/null
+++ b/tests/parsing/strange_keys.pom
@@ -0,0 +1,26 @@
+- = 0
+* = 1
+**-** = 2
+/ = 3
+9.9 = 4
+-2 = 5
+7 = 6
+_ = 7
+__ = 8
+œ = 9
+# combining grave accent
+̀ = 10
+# U+E000 (in Private Use Area)
+ = 11
+# U+102345 (in Private Use Area)
+􂍅 = 12
+# non breaking space
+  = 13
+[̀]
+􂍅 = 14
+[*]
+* = 15
+[-]
+- = 16
+[0]
+0 = 17
diff --git a/tests/parsing/value_and_subkeys.flat.pom b/tests/parsing/value_and_subkeys.flat.pom
new file mode 100644
index 0000000..efce989
--- /dev/null
+++ b/tests/parsing/value_and_subkeys.flat.pom
@@ -0,0 +1,4 @@
+one = "1"
+one.one = "1!!"
+one.two = "2"
+one.two.three = "3"
diff --git a/tests/parsing/value_and_subkeys.pom b/tests/parsing/value_and_subkeys.pom
new file mode 100644
index 0000000..7b89203
--- /dev/null
+++ b/tests/parsing/value_and_subkeys.pom
@@ -0,0 +1,5 @@
+one = 1
+one.one = 1!!
+one.two = 2
+[one.two]
+three = 3