aboutsummaryrefslogtreecommitdiff
path: root/src/test/invalid
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/invalid')
-rw-r--r--src/test/invalid/array-mixed-types-arrays-and-ints.toml1
-rw-r--r--src/test/invalid/array-mixed-types-ints-and-floats.toml1
-rw-r--r--src/test/invalid/array-mixed-types-strings-and-ints.toml1
-rw-r--r--src/test/invalid/datetime-malformed-no-leads.toml1
-rw-r--r--src/test/invalid/datetime-malformed-no-secs.toml1
-rw-r--r--src/test/invalid/datetime-malformed-no-t.toml1
-rw-r--r--src/test/invalid/datetime-malformed-no-z.toml1
-rw-r--r--src/test/invalid/datetime-malformed-with-milli.toml1
-rw-r--r--src/test/invalid/duplicate-key-table.toml5
-rw-r--r--src/test/invalid/duplicate-keys.toml2
-rw-r--r--src/test/invalid/duplicate-tables.toml2
-rw-r--r--src/test/invalid/empty-implicit-table.toml1
-rw-r--r--src/test/invalid/empty-table.toml1
-rw-r--r--src/test/invalid/float-no-leading-zero.toml2
-rw-r--r--src/test/invalid/float-no-trailing-digits.toml2
-rw-r--r--src/test/invalid/key-two-equals.toml1
-rw-r--r--src/test/invalid/string-bad-byte-escape.toml1
-rw-r--r--src/test/invalid/string-bad-escape.toml1
-rw-r--r--src/test/invalid/string-byte-escapes.toml1
-rw-r--r--src/test/invalid/string-no-close.toml1
-rw-r--r--src/test/invalid/table-array-implicit.toml14
-rw-r--r--src/test/invalid/table-array-malformed-bracket.toml2
-rw-r--r--src/test/invalid/table-array-malformed-empty.toml2
-rw-r--r--src/test/invalid/table-nested-brackets-close.toml2
-rw-r--r--src/test/invalid/table-nested-brackets-open.toml2
-rw-r--r--src/test/invalid/text-after-array-entries.toml4
-rw-r--r--src/test/invalid/text-after-integer.toml1
-rw-r--r--src/test/invalid/text-after-string.toml1
-rw-r--r--src/test/invalid/text-after-table.toml1
-rw-r--r--src/test/invalid/text-before-array-separator.toml4
-rw-r--r--src/test/invalid/text-in-array.toml5
31 files changed, 66 insertions, 0 deletions
diff --git a/src/test/invalid/array-mixed-types-arrays-and-ints.toml b/src/test/invalid/array-mixed-types-arrays-and-ints.toml
new file mode 100644
index 0000000..051ec73
--- /dev/null
+++ b/src/test/invalid/array-mixed-types-arrays-and-ints.toml
@@ -0,0 +1 @@
+arrays-and-ints = [1, ["Arrays are not integers."]]
diff --git a/src/test/invalid/array-mixed-types-ints-and-floats.toml b/src/test/invalid/array-mixed-types-ints-and-floats.toml
new file mode 100644
index 0000000..51ebe80
--- /dev/null
+++ b/src/test/invalid/array-mixed-types-ints-and-floats.toml
@@ -0,0 +1 @@
+ints-and-floats = [1, 1.0]
diff --git a/src/test/invalid/array-mixed-types-strings-and-ints.toml b/src/test/invalid/array-mixed-types-strings-and-ints.toml
new file mode 100644
index 0000000..f348308
--- /dev/null
+++ b/src/test/invalid/array-mixed-types-strings-and-ints.toml
@@ -0,0 +1 @@
+strings-and-ints = ["hi", 42]
diff --git a/src/test/invalid/datetime-malformed-no-leads.toml b/src/test/invalid/datetime-malformed-no-leads.toml
new file mode 100644
index 0000000..123f173
--- /dev/null
+++ b/src/test/invalid/datetime-malformed-no-leads.toml
@@ -0,0 +1 @@
+no-leads = 1987-7-05T17:45:00Z
diff --git a/src/test/invalid/datetime-malformed-no-secs.toml b/src/test/invalid/datetime-malformed-no-secs.toml
new file mode 100644
index 0000000..ba93900
--- /dev/null
+++ b/src/test/invalid/datetime-malformed-no-secs.toml
@@ -0,0 +1 @@
+no-secs = 1987-07-05T17:45Z
diff --git a/src/test/invalid/datetime-malformed-no-t.toml b/src/test/invalid/datetime-malformed-no-t.toml
new file mode 100644
index 0000000..617e3c5
--- /dev/null
+++ b/src/test/invalid/datetime-malformed-no-t.toml
@@ -0,0 +1 @@
+no-t = 1987-07-0517:45:00Z
diff --git a/src/test/invalid/datetime-malformed-no-z.toml b/src/test/invalid/datetime-malformed-no-z.toml
new file mode 100644
index 0000000..cf66b1e
--- /dev/null
+++ b/src/test/invalid/datetime-malformed-no-z.toml
@@ -0,0 +1 @@
+no-z = 1987-07-05T17:45:00
diff --git a/src/test/invalid/datetime-malformed-with-milli.toml b/src/test/invalid/datetime-malformed-with-milli.toml
new file mode 100644
index 0000000..eef792f
--- /dev/null
+++ b/src/test/invalid/datetime-malformed-with-milli.toml
@@ -0,0 +1 @@
+with-milli = 1987-07-5T17:45:00.12Z
diff --git a/src/test/invalid/duplicate-key-table.toml b/src/test/invalid/duplicate-key-table.toml
new file mode 100644
index 0000000..cedf05f
--- /dev/null
+++ b/src/test/invalid/duplicate-key-table.toml
@@ -0,0 +1,5 @@
+[fruit]
+type = "apple"
+
+[fruit.type]
+apple = "yes"
diff --git a/src/test/invalid/duplicate-keys.toml b/src/test/invalid/duplicate-keys.toml
new file mode 100644
index 0000000..9b5aee0
--- /dev/null
+++ b/src/test/invalid/duplicate-keys.toml
@@ -0,0 +1,2 @@
+dupe = false
+dupe = true
diff --git a/src/test/invalid/duplicate-tables.toml b/src/test/invalid/duplicate-tables.toml
new file mode 100644
index 0000000..8ddf49b
--- /dev/null
+++ b/src/test/invalid/duplicate-tables.toml
@@ -0,0 +1,2 @@
+[a]
+[a]
diff --git a/src/test/invalid/empty-implicit-table.toml b/src/test/invalid/empty-implicit-table.toml
new file mode 100644
index 0000000..0cc36d0
--- /dev/null
+++ b/src/test/invalid/empty-implicit-table.toml
@@ -0,0 +1 @@
+[naughty..naughty]
diff --git a/src/test/invalid/empty-table.toml b/src/test/invalid/empty-table.toml
new file mode 100644
index 0000000..fe51488
--- /dev/null
+++ b/src/test/invalid/empty-table.toml
@@ -0,0 +1 @@
+[]
diff --git a/src/test/invalid/float-no-leading-zero.toml b/src/test/invalid/float-no-leading-zero.toml
new file mode 100644
index 0000000..cab76bf
--- /dev/null
+++ b/src/test/invalid/float-no-leading-zero.toml
@@ -0,0 +1,2 @@
+answer = .12345
+neganswer = -.12345
diff --git a/src/test/invalid/float-no-trailing-digits.toml b/src/test/invalid/float-no-trailing-digits.toml
new file mode 100644
index 0000000..cbff2d0
--- /dev/null
+++ b/src/test/invalid/float-no-trailing-digits.toml
@@ -0,0 +1,2 @@
+answer = 1.
+neganswer = -1.
diff --git a/src/test/invalid/key-two-equals.toml b/src/test/invalid/key-two-equals.toml
new file mode 100644
index 0000000..25a0378
--- /dev/null
+++ b/src/test/invalid/key-two-equals.toml
@@ -0,0 +1 @@
+key= = 1
diff --git a/src/test/invalid/string-bad-byte-escape.toml b/src/test/invalid/string-bad-byte-escape.toml
new file mode 100644
index 0000000..4c7be59
--- /dev/null
+++ b/src/test/invalid/string-bad-byte-escape.toml
@@ -0,0 +1 @@
+naughty = "\xAg"
diff --git a/src/test/invalid/string-bad-escape.toml b/src/test/invalid/string-bad-escape.toml
new file mode 100644
index 0000000..60acb0c
--- /dev/null
+++ b/src/test/invalid/string-bad-escape.toml
@@ -0,0 +1 @@
+invalid-escape = "This string has a bad \a escape character."
diff --git a/src/test/invalid/string-byte-escapes.toml b/src/test/invalid/string-byte-escapes.toml
new file mode 100644
index 0000000..e94452a
--- /dev/null
+++ b/src/test/invalid/string-byte-escapes.toml
@@ -0,0 +1 @@
+answer = "\x33"
diff --git a/src/test/invalid/string-no-close.toml b/src/test/invalid/string-no-close.toml
new file mode 100644
index 0000000..0c292fc
--- /dev/null
+++ b/src/test/invalid/string-no-close.toml
@@ -0,0 +1 @@
+no-ending-quote = "One time, at band camp
diff --git a/src/test/invalid/table-array-implicit.toml b/src/test/invalid/table-array-implicit.toml
new file mode 100644
index 0000000..05f2507
--- /dev/null
+++ b/src/test/invalid/table-array-implicit.toml
@@ -0,0 +1,14 @@
+# This test is a bit tricky. It should fail because the first use of
+# `[[albums.songs]]` without first declaring `albums` implies that `albums`
+# must be a table. The alternative would be quite weird. Namely, it wouldn't
+# comply with the TOML spec: "Each double-bracketed sub-table will belong to
+# the most *recently* defined table element *above* it."
+#
+# This is in contrast to the *valid* test, table-array-implicit where
+# `[[albums.songs]]` works by itself, so long as `[[albums]]` isn't declared
+# later. (Although, `[albums]` could be.)
+[[albums.songs]]
+name = "Glory Days"
+
+[[albums]]
+name = "Born in the USA"
diff --git a/src/test/invalid/table-array-malformed-bracket.toml b/src/test/invalid/table-array-malformed-bracket.toml
new file mode 100644
index 0000000..39c73b0
--- /dev/null
+++ b/src/test/invalid/table-array-malformed-bracket.toml
@@ -0,0 +1,2 @@
+[[albums]
+name = "Born to Run"
diff --git a/src/test/invalid/table-array-malformed-empty.toml b/src/test/invalid/table-array-malformed-empty.toml
new file mode 100644
index 0000000..a470ca3
--- /dev/null
+++ b/src/test/invalid/table-array-malformed-empty.toml
@@ -0,0 +1,2 @@
+[[]]
+name = "Born to Run"
diff --git a/src/test/invalid/table-nested-brackets-close.toml b/src/test/invalid/table-nested-brackets-close.toml
new file mode 100644
index 0000000..c8b5a67
--- /dev/null
+++ b/src/test/invalid/table-nested-brackets-close.toml
@@ -0,0 +1,2 @@
+[a]b]
+zyx = 42
diff --git a/src/test/invalid/table-nested-brackets-open.toml b/src/test/invalid/table-nested-brackets-open.toml
new file mode 100644
index 0000000..246d7e9
--- /dev/null
+++ b/src/test/invalid/table-nested-brackets-open.toml
@@ -0,0 +1,2 @@
+[a[b]
+zyx = 42
diff --git a/src/test/invalid/text-after-array-entries.toml b/src/test/invalid/text-after-array-entries.toml
new file mode 100644
index 0000000..1a72890
--- /dev/null
+++ b/src/test/invalid/text-after-array-entries.toml
@@ -0,0 +1,4 @@
+array = [
+ "Is there life after an array separator?", No
+ "Entry"
+]
diff --git a/src/test/invalid/text-after-integer.toml b/src/test/invalid/text-after-integer.toml
new file mode 100644
index 0000000..42de7af
--- /dev/null
+++ b/src/test/invalid/text-after-integer.toml
@@ -0,0 +1 @@
+answer = 42 the ultimate answer?
diff --git a/src/test/invalid/text-after-string.toml b/src/test/invalid/text-after-string.toml
new file mode 100644
index 0000000..c92a6f1
--- /dev/null
+++ b/src/test/invalid/text-after-string.toml
@@ -0,0 +1 @@
+string = "Is there life after strings?" No.
diff --git a/src/test/invalid/text-after-table.toml b/src/test/invalid/text-after-table.toml
new file mode 100644
index 0000000..87da9db
--- /dev/null
+++ b/src/test/invalid/text-after-table.toml
@@ -0,0 +1 @@
+[error] this shouldn't be here
diff --git a/src/test/invalid/text-before-array-separator.toml b/src/test/invalid/text-before-array-separator.toml
new file mode 100644
index 0000000..9b06a39
--- /dev/null
+++ b/src/test/invalid/text-before-array-separator.toml
@@ -0,0 +1,4 @@
+array = [
+ "Is there life before an array separator?" No,
+ "Entry"
+]
diff --git a/src/test/invalid/text-in-array.toml b/src/test/invalid/text-in-array.toml
new file mode 100644
index 0000000..a6a6c42
--- /dev/null
+++ b/src/test/invalid/text-in-array.toml
@@ -0,0 +1,5 @@
+array = [
+ "Entry 1",
+ I don't belong,
+ "Entry 2",
+]