Skip to content

Commit 032f0ce

Browse files
StanFromIrelandsethmlarson
authored andcommitted
Add corpus for tomllib fuzzer
1 parent eb273d5 commit 032f0ce

15 files changed

Lines changed: 174 additions & 0 deletions

corp-tomllib/datetime-edge.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
first-offset = 0001-01-01 00:00:00Z
2+
first-local = 0001-01-01 00:00:00
3+
first-date = 0001-01-01
4+
5+
last-offset = 9999-12-31 23:59:59Z
6+
last-local = 9999-12-31 23:59:59
7+
last-date = 9999-12-31

corp-tomllib/escape-tricky.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
end_esc = "String does not end here\" but ends here\\"
2+
lit_end_esc = 'String ends here\'
3+
4+
multiline_unicode = """
5+
\u00a0"""
6+
7+
multiline_not_unicode = """
8+
\\u0041"""
9+
10+
multiline_end_esc = """When will it end? \"""...""\" should be here\""""
11+
12+
lit_multiline_not_unicode = '''
13+
\u007f'''
14+
15+
lit_multiline_end = '''There is no escape\'''

corp-tomllib/escapes.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
backspace = "|\b."
2+
tab = "|\t."
3+
newline = "|\n."
4+
formfeed = "|\f."
5+
carriage = "|\r."
6+
quote = "|\"."
7+
backslash = "|\\."
8+
delete = "|\u007F."
9+
unitseparator = "|\u001F."
10+
11+
# \u is escaped, so should NOT be interperted as a \u escape.
12+
notunicode1 = "|\\u."
13+
notunicode2 = "|\u005Cu."
14+
notunicode3 = "|\\u0075."
15+
notunicode4 = "|\\\u0075."

corp-tomllib/example.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
best-day-ever = 1987-07-05T17:45:00Z
2+
3+
[numtheory]
4+
boring = false
5+
perfection = [6, 28, 496]

corp-tomllib/implicit-groups.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[a.b.c]
2+
answer = 42
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tbl_multiline = { a = 1, b = """
2+
multiline
3+
""", c = """and yet
4+
another line""", d = 4 }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
tbl_tbl_empty = { tbl_0 = {} }
2+
tbl_tbl_val = { tbl_1 = { one = 1 } }
3+
tbl_arr_tbl = { arr_tbl = [ { one = 1 } ] }
4+
arr_tbl_tbl = [ { tbl = { one = 1 } } ]
5+
6+
arr_arr_tbl_empty = [ [ {} ] ]
7+
arr_arr_tbl_val = [ [ { one = 1 } ] ]
8+
arr_arr_tbls = [ [ { one = 1 }, { two = 2 } ] ]

corp-tomllib/key-dotted.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
arr-1 = [{a.b = 1}]
2+
arr-2 = ["str", {a.b = 1}]
3+
4+
arr-3 = [{a.b = 1}, {a.b = 2}]
5+
arr-4 = ["str", {a.b = 1}, {a.b = 2}]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
contributors = [
2+
"Foo Bar <foo@example.com>",
3+
{ name = "Baz Qux", email = "bazqux@example.com", url = "https://example.com/bazqux" }
4+
]
5+
6+
mixed = [{k="a"}, "b", 1]

corp-tomllib/multibyte.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Tèƨƭ ƒïℓè ƒôř TÓM£
2+
# Óñℓ¥ ƭλïƨ ôñè ƭřïèƨ ƭô è₥úℓáƭè á TÓM£ ƒïℓè ωřïƭƭèñ β¥ á úƨèř ôƒ ƭλè ƙïñδ ôƒ ƥářƨèř ωřïƭèřƨ ƥřôβáβℓ¥ λáƭè
3+
4+
['𝐭𝐛𝐥']
5+
string = "𝓼𝓽𝓻𝓲𝓷𝓰 - #" # " 𝓼𝓽𝓻𝓲𝓷𝓰
6+
['𝐭𝐛𝐥'.sub]
7+
'𝕒𝕣𝕣𝕒𝕪' = [ "] ", " # "] # ] 𝓪𝓻𝓻𝓪𝔂
8+
'𝕒𝕣𝕣𝕒𝕪𝟚' = [ "Tèƨƭ #11 ]ƥřôƲèδ ƭλáƭ", "Éжƥèřï₥èñƭ #9 ωáƨ á ƨúççèƨƨ" ]
9+
# Ýôú δïδñ'ƭ ƭλïñƙ ïƭ'δ áƨ èáƨ¥ áƨ çλúçƙïñϱ ôúƭ ƭλè ℓáƨƭ #, δïδ ¥ôú?
10+
another_test_string = "§á₥è ƭλïñϱ, βúƭ ωïƭλ á ƨƭřïñϱ #"
11+
escapes = " Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \"" # "áñδ çô₥₥èñƭƨ ářè ƭλèřè ƭôô"
12+
# Tλïñϱƨ ωïℓℓ ϱèƭ λářδèř
13+
['𝐭𝐛𝐥'.sub."βïƭ#"]
14+
"ωλáƭ?" = "Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?"
15+
multi_line_array = [
16+
"]",
17+
# ] Óλ ¥èƨ Ì δïδ
18+
]

0 commit comments

Comments
 (0)