@@ -34,19 +34,19 @@ function testVersions([input, type], expected) {
3434function testPackFormats ( ) {
3535 const formatsTests = fs . readFileSync ( path . join ( __dirname , 'pack-formats-tests.txt' ) , { 'encoding' : 'utf-8' } )
3636 for ( const line of formatsTests . split ( '\n' ) ) {
37- const parts = line . match ( / ^ " ( .* ) " \( ( r | d | r , d | - ) \) ( \w + | \w + , \w + ) / )
37+ const parts = line . match ( / ^ " ( .* ) " \( ( r | d | r , d | - ) \) ( \w + (?: , \w + ) ? ) / )
3838 if ( ! parts )
3939 continue
4040
4141 const getAns = ans => ans === 'none' ? undefined : ans === 'null' ? null : + ans
4242 const [ , lineName , lineType , lineAns ] = parts
4343 const input = lineName || "[blank]"
44- const type = { 'r' : 'resource' , 'd' : 'data' , 'b ' : 'both' , '-' : undefined } [ lineType ]
44+ const type = { 'r' : 'resource' , 'd' : 'data' , 'r,d ' : 'both' , '-' : undefined } [ lineType ]
4545 if ( type === 'both' ) {
4646 // multiple: data AND resource
4747 const [ resourceAns , dataAns ] = lineAns . split ( ',' )
48- testPackFormat ( input , type , getAns ( resourceAns ) )
49- testPackFormat ( input , type , getAns ( dataAns ) )
48+ testPackFormat ( input , 'resource' , getAns ( resourceAns ) )
49+ testPackFormat ( input , 'data' , getAns ( dataAns ) )
5050 }
5151 else {
5252 // either data OR resource
0 commit comments