-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-toml-test
executable file
·211 lines (203 loc) · 9.64 KB
/
run-toml-test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2024 Pablo Martinez Bernal (elpekenin)
#
# SPDX-License-Identifier: MIT
# TODO?: Run unittest here too?
# WIP: Invalid tests still to be checked
# Some features might get added while doing so
OUTPUT=toml-test.out
# Run specification tests using toml-test
# https://github.com/toml-lang/toml-test
# NOTE: Tests skipped because a feature is not supported may still be broken
# after it gets implemented (some other "masked" issue)
skip=(
-skip 'valid/array/array' # multiline array + time
-skip 'valid/array/array-subtables' # table array
-skip 'valid/array/mixed-string-table' # multiline array
-skip 'valid/array/nested-double' # multiline array
-skip 'valid/array/nested-inline-table' # inline table
-skip 'valid/array/open-parent-table' # table array
-skip 'valid/array/string-quote-comma' # multiline array
-skip 'valid/array/string-with-comma' # multiline array
-skip 'valid/array/string-with-comma-2' # multiline array + multinine str
-skip 'valid/array/table-array-string-backslash' # inline table
-skip 'valid/array/trailing-comma' # multiline array
-skip 'valid/comment/everywhere' # multiline array
-skip 'valid/comment/nonascii' # collides with DEL (\x7F) detection
-skip 'valid/comment/tricky' # multiline str + scientific + multiline array + inline table
-skip 'valid/datetime/datetime' # time
-skip 'valid/datetime/edge' # time
-skip 'valid/datetime/leap-year' # time
-skip 'valid/datetime/local' # time
-skip 'valid/datetime/local-date' # time
-skip 'valid/datetime/local-time' # time
-skip 'valid/datetime/milliseconds' # time
-skip 'valid/datetime/timezone' # time
-skip 'valid/example' # time
-skip 'valid/float/exponent' # scientific
-skip 'valid/float/underscore' # underscore
-skip 'valid/float/zero' # scientific
-skip 'valid/inline-table/array' # inline table + multiline array
-skip 'valid/inline-table/array-values' # inline table + multiline array
-skip 'valid/inline-table/bool' # inline table
-skip 'valid/inline-table/empty' # inline table
-skip 'valid/inline-table/end-in-bool' # inline table
-skip 'valid/inline-table/inline-table' # inline table
-skip 'valid/inline-table/key-dotted-1' # inline table
-skip 'valid/inline-table/key-dotted-2' # inline table
-skip 'valid/inline-table/key-dotted-3' # inline table
-skip 'valid/inline-table/key-dotted-4' # inline table + table array
-skip 'valid/inline-table/key-dotted-5' # inline table
-skip 'valid/inline-table/key-dotted-6' # inline table + multiline array
-skip 'valid/inline-table/key-dotted-7' # inline table + multiline array
-skip 'valid/inline-table/multiline' # inline table + multiline str
-skip 'valid/inline-table/nest' # inline table
-skip 'valid/inline-table/spaces' # inline table + multiline array
-skip 'valid/key/dotted-4' # table array
-skip 'valid/key/escapes' # str
-skip 'valid/key/quoted-unicode' # str
-skip 'valid/key/start' # inline table
-skip 'valid/spec-example-1' # time + multiline array
-skip 'valid/spec-example-1-compact' # time + multiline array
-skip 'valid/spec/array-0' # multiline array
-skip 'valid/spec/array-1' # multiline array
-skip 'valid/spec/array-of-tables-0' # table array
-skip 'valid/spec/array-of-tables-1' # table array
-skip 'valid/spec/array-of-tables-2' # multiline array + inline table
-skip 'valid/spec/float-0' # scientific
-skip 'valid/spec/inline-table-0' # inline table
-skip 'valid/spec/inline-table-2' # inline table
-skip 'valid/spec/integer-1' # underscore
-skip 'valid/spec/local-date-0' # time
-skip 'valid/spec/local-date-time-0' # time
-skip 'valid/spec/local-time-0' # time
-skip 'valid/spec/offset-date-time-0' # time
-skip 'valid/spec/offset-date-time-1' # time
-skip 'valid/spec/string-1' # multiline str
-skip 'valid/spec/string-3' # multiline str
-skip 'valid/spec/string-4' # escape (?)
-skip 'valid/spec/string-5' # str
-skip 'valid/spec/string-6' # multiline str
-skip 'valid/spec/string-7' # str
-skip 'valid/spec/table-7' # time
-skip 'valid/string/ends-in-whitespace-escape' # multiline
-skip 'valid/string/escape-tricky' # str
-skip 'valid/string/multiline' # multiline str
-skip 'valid/string/multiline-empty' # multiline str
-skip 'valid/string/multiline-escaped-crlf' # multiline str
-skip 'valid/string/multiline-quotes' # multiline str
-skip 'valid/string/nl' # str
-skip 'valid/string/quoted-unicode' # str
-skip 'valid/string/raw' # str
-skip 'valid/string/raw-multiline' # multiline str
-skip 'valid/string/start-mb' # multiline str
-skip 'valid/string/unicode-escape' # str
-skip 'valid/table/array-implicit' # table array
-skip 'valid/table/array-implicit-and-explicit-after' # table array
-skip 'valid/table/array-many' # table array
-skip 'valid/table/array-nest' # table array
-skip 'valid/table/array-one' # table array
-skip 'valid/table/array-table-array' # table array
-skip 'valid/table/array-within-dotted' # table array
# -----
-skip 'invalid/array/extend-defined-aot' # table array
-skip 'invalid/array/tables-1' # table array
-skip 'invalid/array/tables-2' # table array
# -skip 'invalid/control/comment-ff'
# -skip 'invalid/control/comment-lf'
# -skip 'invalid/control/multi-lf'
# -skip 'invalid/control/rawmulti-lf'
# -skip 'invalid/control/rawstring-lf'
# -skip 'invalid/control/string-lf'
# -skip 'invalid/encoding/bad-codepoint'
# -skip 'invalid/encoding/bad-utf8-in-comment'
# -skip 'invalid/encoding/bad-utf8-in-multiline'
# -skip 'invalid/encoding/bad-utf8-in-multiline-literal'
# -skip 'invalid/encoding/bad-utf8-in-string'
# -skip 'invalid/encoding/bad-utf8-in-string-literal'
# -skip 'invalid/float/leading-zero'
# -skip 'invalid/float/leading-zero-neg'
# -skip 'invalid/float/leading-zero-plus'
# -skip 'invalid/integer/leading-zero-1'
# -skip 'invalid/integer/leading-zero-2'
# -skip 'invalid/integer/leading-zero-sign-1'
# -skip 'invalid/integer/leading-zero-sign-2'
# -skip 'invalid/integer/us-after-bin'
# -skip 'invalid/integer/us-after-hex'
# -skip 'invalid/integer/us-after-oct'
# -skip 'invalid/key/after-array'
# -skip 'invalid/key/after-table'
# -skip 'invalid/key/after-value'
# -skip 'invalid/key/bare-invalid-character'
# -skip 'invalid/key/duplicate-keys-1'
# -skip 'invalid/key/duplicate-keys-2'
# -skip 'invalid/key/duplicate-keys-3'
# -skip 'invalid/key/duplicate-keys-4'
# -skip 'invalid/key/escape'
# -skip 'invalid/key/open-bracket'
# -skip 'invalid/key/partial-quoted'
# -skip 'invalid/key/space'
# -skip 'invalid/key/special-character'
# -skip 'invalid/key/start-bracket'
# -skip 'invalid/key/start-dot'
# -skip 'invalid/spec/table-9-0'
# -skip 'invalid/spec/table-9-1'
# -skip 'invalid/string/bad-byte-escape'
# -skip 'invalid/string/bad-concat'
# -skip 'invalid/string/bad-escape-1'
# -skip 'invalid/string/bad-escape-2'
# -skip 'invalid/string/bad-hex-esc-1'
# -skip 'invalid/string/bad-hex-esc-2'
# -skip 'invalid/string/bad-hex-esc-3'
# -skip 'invalid/string/bad-hex-esc-4'
# -skip 'invalid/string/bad-hex-esc-5'
# -skip 'invalid/string/bad-slash-escape'
# -skip 'invalid/string/bad-uni-esc-1'
# -skip 'invalid/string/bad-uni-esc-2'
# -skip 'invalid/string/bad-uni-esc-3'
# -skip 'invalid/string/bad-uni-esc-4'
# -skip 'invalid/string/bad-uni-esc-5'
# -skip 'invalid/string/bad-uni-esc-6'
# -skip 'invalid/string/bad-uni-esc-7'
# -skip 'invalid/string/basic-byte-escapes'
# -skip 'invalid/string/basic-multiline-out-of-range-unicode-escape-1'
# -skip 'invalid/string/basic-multiline-out-of-range-unicode-escape-2'
# -skip 'invalid/string/basic-multiline-unknown-escape'
# -skip 'invalid/string/basic-out-of-range-unicode-escape-1'
# -skip 'invalid/string/basic-out-of-range-unicode-escape-2'
# -skip 'invalid/string/basic-unknown-escape'
# -skip 'invalid/string/multiline-bad-escape-1'
# -skip 'invalid/string/multiline-bad-escape-2'
# -skip 'invalid/string/multiline-bad-escape-3'
# -skip 'invalid/table/append-to-array-with-dotted-keys'
# -skip 'invalid/table/append-with-dotted-keys-1'
# -skip 'invalid/table/append-with-dotted-keys-2'
# -skip 'invalid/table/array-empty'
# -skip 'invalid/table/array-implicit'
# -skip 'invalid/table/array-no-close-1'
# -skip 'invalid/table/array-no-close-2'
# -skip 'invalid/table/duplicate'
# -skip 'invalid/table/duplicate-key-dotted-array'
# -skip 'invalid/table/duplicate-key-dotted-table'
# -skip 'invalid/table/duplicate-key-dotted-table2'
# -skip 'invalid/table/duplicate-table-array'
# -skip 'invalid/table/duplicate-table-array2'
# -skip 'invalid/table/empty'
# -skip 'invalid/table/empty-implicit-table'
# -skip 'invalid/table/llbrace'
# -skip 'invalid/table/nested-brackets-close'
# -skip 'invalid/table/nested-brackets-open'
# -skip 'invalid/table/overwrite-array-in-parent'
# -skip 'invalid/table/overwrite-bool-with-array'
# -skip 'invalid/table/redefine-2'
# -skip 'invalid/table/redefine-3'
# -skip 'invalid/table/rrbrace'
# -skip 'invalid/table/super-twice'
# -skip 'invalid/table/whitespace'
)
if [[ "$1" == noskip ]]
then
skip=(-print-skip)
fi
THIS=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
toml-test -color never ${skip[@]} ${THIS}/toml-test-decoder > ${OUTPUT} 2>&1