@@ -204,109 +204,94 @@ Deno.test("parsePath()", async () => {
204204Deno . test ( "validTarStreamOptions()" , ( ) => {
205205 assertValidTarStreamOptions ( { } ) ;
206206
207- assertValidTarStreamOptions ( { mode : 0 } ) ;
207+ assertValidTarStreamOptions ( { mode : 0o0 } ) ;
208208 assertThrows (
209- ( ) => assertValidTarStreamOptions ( { mode : 8 } ) ,
209+ ( ) => assertValidTarStreamOptions ( { mode : 0o1111111 } ) ,
210210 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" ,
217212 ) ;
218213
219- assertValidTarStreamOptions ( { uid : 0 } ) ;
214+ assertValidTarStreamOptions ( { uid : 0o0 } ) ;
220215 assertThrows (
221- ( ) => assertValidTarStreamOptions ( { uid : 8 } ) ,
216+ ( ) => assertValidTarStreamOptions ( { uid : 0o1111111 } ) ,
222217 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" ,
229219 ) ;
230220
231- assertValidTarStreamOptions ( { gid : 0 } ) ;
232- assertThrows (
233- ( ) => assertValidTarStreamOptions ( { gid : 8 } ) ,
234- TypeError ,
235- "Invalid GID provided" ,
236- ) ;
221+ assertValidTarStreamOptions ( { gid : 0o0 } ) ;
237222 assertThrows (
238- ( ) => assertValidTarStreamOptions ( { gid : 1111111 } ) ,
223+ ( ) => assertValidTarStreamOptions ( { gid : 0o1111111 } ) ,
239224 TypeError ,
240- "Invalid GID provided" ,
225+ "Cannot add to the tar archive: Invalid GID provided" ,
241226 ) ;
242227
243- assertValidTarStreamOptions ( { mtime : 0 } ) ;
228+ assertValidTarStreamOptions ( { mtime : 0o0 } ) ;
244229 assertThrows (
245230 ( ) => assertValidTarStreamOptions ( { mtime : NaN } ) ,
246231 TypeError ,
247- "Invalid MTime provided" ,
232+ "Cannot add to the tar archive: Invalid MTime provided" ,
248233 ) ;
249234 assertValidTarStreamOptions ( {
250235 mtime : Math . floor ( new Date ( ) . getTime ( ) / 1000 ) ,
251236 } ) ;
252237 assertThrows (
253238 ( ) => assertValidTarStreamOptions ( { mtime : new Date ( ) . getTime ( ) } ) ,
254239 TypeError ,
255- "Invalid MTime provided" ,
240+ "Cannot add to the tar archive: Invalid MTime provided" ,
256241 ) ;
257242
258243 assertValidTarStreamOptions ( { uname : "" } ) ;
259244 assertValidTarStreamOptions ( { uname : "abcdef" } ) ;
260245 assertThrows (
261246 ( ) => assertValidTarStreamOptions ( { uname : "å-abcdef" } ) ,
262247 TypeError ,
263- "Invalid UName provided" ,
248+ "Cannot add to the tar archive: Invalid UName provided" ,
264249 ) ;
265250 assertThrows (
266251 ( ) => assertValidTarStreamOptions ( { uname : "a" . repeat ( 100 ) } ) ,
267252 TypeError ,
268- "Invalid UName provided" ,
253+ "Cannot add to the tar archive: Invalid UName provided" ,
269254 ) ;
270255
271256 assertValidTarStreamOptions ( { gname : "" } ) ;
272257 assertValidTarStreamOptions ( { gname : "abcdef" } ) ;
273258 assertThrows (
274259 ( ) => assertValidTarStreamOptions ( { gname : "å-abcdef" } ) ,
275260 TypeError ,
276- "Invalid GName provided" ,
261+ "Cannot add to the tar archive: Invalid GName provided" ,
277262 ) ;
278263 assertThrows (
279264 ( ) => assertValidTarStreamOptions ( { gname : "a" . repeat ( 100 ) } ) ,
280265 TypeError ,
281- "Invalid GName provided" ,
266+ "Cannot add to the tar archive: Invalid GName provided" ,
282267 ) ;
283268
284269 assertValidTarStreamOptions ( { devmajor : "" } ) ;
285270 assertValidTarStreamOptions ( { devmajor : "1234" } ) ;
286271 assertThrows (
287272 ( ) => assertValidTarStreamOptions ( { devmajor : "123456789" } ) ,
288273 TypeError ,
289- "Invalid DevMajor provided" ,
274+ "Cannot add to the tar archive: Invalid DevMajor provided" ,
290275 ) ;
291276
292277 assertValidTarStreamOptions ( { devminor : "" } ) ;
293278 assertValidTarStreamOptions ( { devminor : "1234" } ) ;
294279 assertThrows (
295280 ( ) => assertValidTarStreamOptions ( { devminor : "123456789" } ) ,
296281 TypeError ,
297- "Invalid DevMinor provided" ,
282+ "Cannot add to the tar archive: Invalid DevMinor provided" ,
298283 ) ;
299284} ) ;
300285
301286Deno . test ( "TarStream() with invalid options" , async ( ) => {
302287 const readable = ReadableStream . from < TarStreamInput > ( [
303- { type : "directory" , path : "potato" , options : { mode : 9 } } ,
288+ { type : "directory" , path : "potato" , options : { mode : 0o1111111 } } ,
304289 ] ) . pipeThrough ( new TarStream ( ) ) ;
305290
306291 await assertRejects (
307292 ( ) => Array . fromAsync ( readable ) ,
308293 TypeError ,
309- "Invalid Mode provided" ,
294+ "Cannot add to the tar archive: Invalid Mode provided" ,
310295 ) ;
311296} ) ;
312297
0 commit comments