@@ -99,8 +99,14 @@ t.test("compare with original decodeURIComponent", async (t) => {
99
99
} catch {
100
100
//
101
101
}
102
- t . equal ( safeDecodeURIComponent ( testCase ) , origResult ) ;
102
+ if ( safeDecodeURIComponent ( testCase ) !== origResult ) {
103
+ t . fail (
104
+ `safeDecodeURIComponent("${ testCase } ") !== decodeURIComponent("${ testCase } ")`
105
+ ) ;
106
+ }
103
107
}
108
+
109
+ t . pass ( "All test cases passed" ) ;
104
110
} ) ;
105
111
106
112
t . test ( "benchmark" , async ( t ) => {
@@ -153,11 +159,20 @@ t.test("S15.1.3.2_A1.10_T1", async (t) => {
153
159
indexJ <= interval [ indexI ] [ 1 ] ;
154
160
indexJ ++
155
161
) {
156
- t . equal (
157
- safeDecodeURIComponent ( "%C0%" + String . fromCharCode ( indexJ , indexJ ) ) ,
162
+ if (
163
+ safeDecodeURIComponent ( "%C0%" + String . fromCharCode ( indexJ , indexJ ) ) !==
158
164
undefined
159
- ) ;
165
+ ) {
166
+ t . fail (
167
+ `safeDecodeURIComponent("%C0%${ String . fromCharCode (
168
+ indexJ ,
169
+ indexJ
170
+ ) } ") should be undefined`
171
+ ) ;
172
+ }
160
173
}
174
+
175
+ t . pass ( "All test cases passed" ) ;
161
176
}
162
177
} ) ;
163
178
@@ -174,14 +189,22 @@ t.test("S15.1.3.2_A1.11_T1", async (t) => {
174
189
indexJ <= interval [ indexI ] [ 1 ] ;
175
190
indexJ ++
176
191
) {
177
- t . equal (
192
+ if (
178
193
safeDecodeURIComponent (
179
194
"%E0%" + String . fromCharCode ( indexJ , indexJ ) + "%A0"
180
- ) ,
181
- undefined
182
- ) ;
195
+ ) !== undefined
196
+ ) {
197
+ t . fail (
198
+ `safeDecodeURIComponent("%E0%${ String . fromCharCode (
199
+ indexJ ,
200
+ indexJ
201
+ ) } %A0") should be undefined`
202
+ ) ;
203
+ }
183
204
}
184
205
}
206
+
207
+ t . pass ( "All test cases passed" ) ;
185
208
} ) ;
186
209
187
210
t . test ( "S15.1.3.2_A1.1_T1" , async ( t ) => {
0 commit comments