Skip to content

Commit 65b96b5

Browse files
committed
Add test cases for empty value/whitespace in key
1 parent b97d033 commit 65b96b5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testsrc/ConfigParser/Parsertest.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ test_basic =
4343
[("Cemptysect", [])]
4444
,f "comments4" "[emptysect]\n# [nonexistant]\n" [("emptysect", [])]
4545
,f "simple section" "[sect1]\nfoo: bar\n" [("sect1", [("foo", "bar")])]
46+
,f "empty value" "[sect1]\nfoo: \n" [("sect1", [("foo", "")])]
4647
,f "comments5" "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\no3: v3"
4748
[("sect1", [("o1", "v1"), ("o2", "v2"), ("o3", "v3")])]
4849
,f "comments5ext" "\n#foo\n[sect1]\n\n#iiii \no1: v1\no2: v2\n o3: v3"
@@ -53,6 +54,7 @@ test_basic =
5354
,f "default1" "v1: o1\n[sect1]\nv2: o2" [("DEFAULT", [("v1", "o1")]),
5455
("sect1", [("v2", "o2")])]
5556
,f "simple default" "foo: bar" [("DEFAULT", [("foo", "bar")])]
57+
,f "whitespace in key" "foo bar : baz" [("DEFAULT", [("foo bar", "baz")])]
5658
]
5759

5860
test_asserts =

0 commit comments

Comments
 (0)