@@ -204,109 +204,94 @@ Deno.test("parsePath()", async () => {
204
204
Deno . test ( "validTarStreamOptions()" , ( ) => {
205
205
assertValidTarStreamOptions ( { } ) ;
206
206
207
- assertValidTarStreamOptions ( { mode : 0 } ) ;
207
+ assertValidTarStreamOptions ( { mode : 0o0 } ) ;
208
208
assertThrows (
209
- ( ) => assertValidTarStreamOptions ( { mode : 8 } ) ,
209
+ ( ) => assertValidTarStreamOptions ( { mode : 0o1111111 } ) ,
210
210
TypeError ,
211
- "Invalid Mode provided" ,
212
- ) ;
213
- assertThrows (
214
- ( ) => assertValidTarStreamOptions ( { mode : 1111111 } ) ,
215
- TypeError ,
216
- "Invalid Mode provided" ,
211
+ "Cannot add to the tar archive: Invalid Mode provided" ,
217
212
) ;
218
213
219
- assertValidTarStreamOptions ( { uid : 0 } ) ;
214
+ assertValidTarStreamOptions ( { uid : 0o0 } ) ;
220
215
assertThrows (
221
- ( ) => assertValidTarStreamOptions ( { uid : 8 } ) ,
216
+ ( ) => assertValidTarStreamOptions ( { uid : 0o1111111 } ) ,
222
217
TypeError ,
223
- "Invalid UID provided" ,
224
- ) ;
225
- assertThrows (
226
- ( ) => assertValidTarStreamOptions ( { uid : 1111111 } ) ,
227
- TypeError ,
228
- "Invalid UID provided" ,
218
+ "Cannot add to the tar archive: Invalid UID provided" ,
229
219
) ;
230
220
231
- assertValidTarStreamOptions ( { gid : 0 } ) ;
232
- assertThrows (
233
- ( ) => assertValidTarStreamOptions ( { gid : 8 } ) ,
234
- TypeError ,
235
- "Invalid GID provided" ,
236
- ) ;
221
+ assertValidTarStreamOptions ( { gid : 0o0 } ) ;
237
222
assertThrows (
238
- ( ) => assertValidTarStreamOptions ( { gid : 1111111 } ) ,
223
+ ( ) => assertValidTarStreamOptions ( { gid : 0o1111111 } ) ,
239
224
TypeError ,
240
- "Invalid GID provided" ,
225
+ "Cannot add to the tar archive: Invalid GID provided" ,
241
226
) ;
242
227
243
- assertValidTarStreamOptions ( { mtime : 0 } ) ;
228
+ assertValidTarStreamOptions ( { mtime : 0o0 } ) ;
244
229
assertThrows (
245
230
( ) => assertValidTarStreamOptions ( { mtime : NaN } ) ,
246
231
TypeError ,
247
- "Invalid MTime provided" ,
232
+ "Cannot add to the tar archive: Invalid MTime provided" ,
248
233
) ;
249
234
assertValidTarStreamOptions ( {
250
235
mtime : Math . floor ( new Date ( ) . getTime ( ) / 1000 ) ,
251
236
} ) ;
252
237
assertThrows (
253
238
( ) => assertValidTarStreamOptions ( { mtime : new Date ( ) . getTime ( ) } ) ,
254
239
TypeError ,
255
- "Invalid MTime provided" ,
240
+ "Cannot add to the tar archive: Invalid MTime provided" ,
256
241
) ;
257
242
258
243
assertValidTarStreamOptions ( { uname : "" } ) ;
259
244
assertValidTarStreamOptions ( { uname : "abcdef" } ) ;
260
245
assertThrows (
261
246
( ) => assertValidTarStreamOptions ( { uname : "å-abcdef" } ) ,
262
247
TypeError ,
263
- "Invalid UName provided" ,
248
+ "Cannot add to the tar archive: Invalid UName provided" ,
264
249
) ;
265
250
assertThrows (
266
251
( ) => assertValidTarStreamOptions ( { uname : "a" . repeat ( 100 ) } ) ,
267
252
TypeError ,
268
- "Invalid UName provided" ,
253
+ "Cannot add to the tar archive: Invalid UName provided" ,
269
254
) ;
270
255
271
256
assertValidTarStreamOptions ( { gname : "" } ) ;
272
257
assertValidTarStreamOptions ( { gname : "abcdef" } ) ;
273
258
assertThrows (
274
259
( ) => assertValidTarStreamOptions ( { gname : "å-abcdef" } ) ,
275
260
TypeError ,
276
- "Invalid GName provided" ,
261
+ "Cannot add to the tar archive: Invalid GName provided" ,
277
262
) ;
278
263
assertThrows (
279
264
( ) => assertValidTarStreamOptions ( { gname : "a" . repeat ( 100 ) } ) ,
280
265
TypeError ,
281
- "Invalid GName provided" ,
266
+ "Cannot add to the tar archive: Invalid GName provided" ,
282
267
) ;
283
268
284
269
assertValidTarStreamOptions ( { devmajor : "" } ) ;
285
270
assertValidTarStreamOptions ( { devmajor : "1234" } ) ;
286
271
assertThrows (
287
272
( ) => assertValidTarStreamOptions ( { devmajor : "123456789" } ) ,
288
273
TypeError ,
289
- "Invalid DevMajor provided" ,
274
+ "Cannot add to the tar archive: Invalid DevMajor provided" ,
290
275
) ;
291
276
292
277
assertValidTarStreamOptions ( { devminor : "" } ) ;
293
278
assertValidTarStreamOptions ( { devminor : "1234" } ) ;
294
279
assertThrows (
295
280
( ) => assertValidTarStreamOptions ( { devminor : "123456789" } ) ,
296
281
TypeError ,
297
- "Invalid DevMinor provided" ,
282
+ "Cannot add to the tar archive: Invalid DevMinor provided" ,
298
283
) ;
299
284
} ) ;
300
285
301
286
Deno . test ( "TarStream() with invalid options" , async ( ) => {
302
287
const readable = ReadableStream . from < TarStreamInput > ( [
303
- { type : "directory" , path : "potato" , options : { mode : 9 } } ,
288
+ { type : "directory" , path : "potato" , options : { mode : 0o1111111 } } ,
304
289
] ) . pipeThrough ( new TarStream ( ) ) ;
305
290
306
291
await assertRejects (
307
292
( ) => Array . fromAsync ( readable ) ,
308
293
TypeError ,
309
- "Invalid Mode provided" ,
294
+ "Cannot add to the tar archive: Invalid Mode provided" ,
310
295
) ;
311
296
} ) ;
312
297
0 commit comments