@@ -226,36 +226,31 @@ function run(script, args, options = undefined) {
226226}
227227
228228{
229+ const benchmark = path . resolve (
230+ __dirname , '../../benchmark/buffers/buffer-compare-offset.js' ) ;
231+ const nodeBenchmark = path . resolve (
232+ __dirname , '../../benchmark/buffers/_buffer-compare-offset.node-bench.js' ) ;
229233 const legacy = run ( legacyScatter , [
230234 '--runs' , '1' ,
231- path . resolve ( __dirname , '../../ benchmark/crypto/create-hash.js' ) ,
235+ benchmark ,
232236 ] ) ;
233237 const modern = run ( scatter , [
234238 '--runs' , '1' ,
235- '--' , path . resolve (
236- __dirname , '../../benchmark/crypto/_create-hash.node-bench.js' ) ,
239+ '--' , nodeBenchmark ,
237240 ] ) ;
238241 assert . strictEqual ( legacy . status , 0 , legacy . stderr ) ;
239242 assert . strictEqual ( modern . status , 0 , modern . stderr ) ;
240243 const legacyLines = legacy . stdout . trim ( ) . split ( '\n' ) ;
241244 const modernLines = modern . stdout . trim ( ) . split ( '\n' ) ;
242- assert . strictEqual ( legacyLines [ 0 ] . replaceAll ( ' ' , '' ) , modernLines [ 0 ] ) ;
243- const name = path . join ( 'crypto' , 'create-hash.js' ) ;
245+ assert . deepStrictEqual (
246+ legacyLines [ 0 ] . replaceAll ( ' ' , '' ) . split ( ',' ) . sort ( ) ,
247+ modernLines [ 0 ] . split ( ',' ) . sort ( ) ,
248+ ) ;
249+ assert . strictEqual ( modernLines [ 0 ] ,
250+ '"filename","method","n","size","rate","time"' ) ;
251+ assert . strictEqual ( legacyLines . length , 9 ) ;
252+ assert . strictEqual ( modernLines . length , 9 ) ;
253+ const name = path . join ( 'buffers' , 'buffer-compare-offset.js' ) ;
244254 assert ( legacyLines [ 1 ] . startsWith ( `"${ name } ",` ) ) ;
245255 assert ( modernLines [ 1 ] . startsWith ( `"${ name } ",` ) ) ;
246256}
247-
248- {
249- const result = run ( scatter , [
250- '--runs' , '1' ,
251- '--' , path . resolve (
252- __dirname ,
253- '../../benchmark/buffers/_buffer-compare-offset.node-bench.js' ,
254- ) ,
255- ] ) ;
256- assert . strictEqual ( result . status , 0 , result . stderr ) ;
257- const lines = result . stdout . trim ( ) . split ( '\n' ) ;
258- assert . strictEqual ( lines [ 0 ] ,
259- '"filename","method","n","size","rate","time"' ) ;
260- assert . strictEqual ( lines . length , 9 ) ;
261- }
0 commit comments