Skip to content

Commit 9dd31f6

Browse files
committed
test: update cache key serialization tests to match parser cache behavior
Update test expectations for `typeCast` field to reflect actual implementation where `typeCast` returns the value directly instead of the type. This aligns tests with the `lib/parsers/parser_cache.js` key generation logic. Signed-off-by: Mohit Malhotra <[email protected]>
1 parent 2001db3 commit 9dd31f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/esm/unit/parsers/cache-key-serialization.test.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,25 +383,25 @@ const result9 = _keyFromFields(
383383

384384
assert.deepStrictEqual(
385385
result1,
386-
'[null,"undefined",null,false,false,false,"undefined",null,false,null,[null,null,null,null,null,null,null]]'
386+
'[null,"undefined",null,false,false,false,null,null,false,null,[null,null,null,null,null,null,null]]'
387387
);
388388
assert(JSON.parse(result1));
389389

390390
assert.deepStrictEqual(
391391
result2,
392-
'[null,"undefined",null,false,false,false,"undefined","local",false,null,[null,null,null,null,null,null,null]]'
392+
'[null,"undefined",null,false,false,false,null,"local",false,null,[null,null,null,null,null,null,null]]'
393393
);
394394
assert(JSON.parse(result2));
395395

396396
assert.deepStrictEqual(
397397
result3,
398-
'[null,"string","",false,false,false,"boolean","local",false,false,[null,null,null,null,null,null,null]]'
398+
'[null,"string","",false,false,false,true,"local",false,false,[null,null,null,null,null,null,null]]'
399399
);
400400
assert(JSON.parse(result3));
401401

402402
assert.deepStrictEqual(
403403
result4,
404-
'["binary","boolean",false,false,false,false,"boolean","local",false,"DATETIME",["id","3",null,"test","test","16899","63"],["value","246",null,"test","test","0","63"]]'
404+
'["binary","boolean",false,false,false,false,true,"local",false,"DATETIME",["id","3",null,"test","test","16899","63"],["value","246",null,"test","test","0","63"]]'
405405
);
406406
assert(JSON.parse(result4));
407407

@@ -410,14 +410,14 @@ assert(JSON.parse(result5));
410410

411411
assert.deepStrictEqual(
412412
result6,
413-
'["binary","boolean",false,true,true,true,"boolean","\\"\\"`\'",true,"#",[":","©",null,"/",",","_","❌"]]'
413+
'["binary","boolean",false,true,true,true,true,"\\"\\"`\'",true,"#",[":","©",null,"/",",","_","❌"]]'
414414
);
415415
// Ensuring that JSON is valid with invalid delimiters
416416
assert(JSON.parse(result6));
417417

418418
assert.deepStrictEqual(
419419
result7,
420-
'["binary","boolean",true,true,true,true,"boolean","local",true,"DATETIME",["id","3",null,"test","test","16899","63"],["value","246",null,"test","test","0","63"]]'
420+
'["binary","boolean",true,true,true,true,true,"local",true,"DATETIME",["id","3",null,"test","test","16899","63"],["value","246",null,"test","test","0","63"]]'
421421
);
422422
assert(JSON.parse(result7));
423423

0 commit comments

Comments
 (0)