aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-09 12:47:21 -0400
committerJack Lloyd <[email protected]>2018-09-09 12:47:21 -0400
commite79eec4e92e05b42d70acf578256adcfb0a0c22d (patch)
tree07d3ab12911f214a852715d2d3d8c7d9cf2bcb2a /src/tests/data
parent4d75da1814c44aa891feaffa3d118acf8329e499 (diff)
parentfb656ae863fd5b755e4bc0e779b95d34e1106219 (diff)
Merge GH #1678 Add read_kv utility function
Diffstat (limited to 'src/tests/data')
-rw-r--r--src/tests/data/utils/read_kv.vec50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/tests/data/utils/read_kv.vec b/src/tests/data/utils/read_kv.vec
new file mode 100644
index 000000000..c8c970ac6
--- /dev/null
+++ b/src/tests/data/utils/read_kv.vec
@@ -0,0 +1,50 @@
+[Valid]
+Input =
+Expected =
+
+Input = K=V
+Expected = K|V
+
+Input = K=V,K2=C\,omma
+Expected = K|V|K2|C,omma
+
+Input = K=V,K2=C\,omma,Eq=1\=1\,orsoihear
+Expected = K|V|K2|C,omma|Eq|1=1,orsoihear
+
+Input = Key=Escape\\fromNewYork
+Expected = Key|Escape\fromNewYork
+
+Input = Key=,Empty=SoVery
+Expected = Key||Empty|SoVery
+
+Input = TheKey\==Equals,Normal=OK
+Expected = TheKey=|Equals|Normal|OK
+
+[Invalid]
+
+Input = K=V,K2=V,K=V2
+Expected = Bad KV spec duplicated key
+
+Input = K=V,K2=V,K2=V2,K=V2
+Expected = Bad KV spec duplicated key
+
+Input = K=V,,K2=V
+Expected = Bad KV spec empty key
+
+Input = K==V,K2=V
+Expected = Bad KV spec unexpected equals sign
+
+Input = K=V,K2==V
+Expected = Bad KV spec unexpected equals sign
+
+Input = K=V,K2=V,
+Expected = Bad KV spec
+
+Input = K=V,K2=V,Wut
+Expected = Bad KV spec incomplete string
+
+Input = =V,K2=V
+Expected = Bad KV spec empty key
+
+Input = V
+Expected = Bad KV spec incomplete string