From 9a29eb896a069db2ba987a23bae42102a9509855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 24 Feb 2022 14:49:56 +0100 Subject: [PATCH] test: adapt test-v8-serdes for V8 9.9 V8 changed the serialization format so we cannot expect that a value serialized by an old version can be reserialized to the same bytes. Change the test to expect that deserialization of the old value still works. Closes: https://github.com/nodejs/node/issues/41519 --- test/parallel/test-v8-serdes.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-v8-serdes.js b/test/parallel/test-v8-serdes.js index 4dffedd3c32b4b..ed8607f3b79bae 100644 --- a/test/parallel/test-v8-serdes.js +++ b/test/parallel/test-v8-serdes.js @@ -155,18 +155,15 @@ const hostObject = new (internalBinding('js_stream').JSStream)(); } { + // Test that an old serialized value can still be deserialized. const buf = Buffer.from('ff0d6f2203666f6f5e007b01', 'hex'); const des = new v8.DefaultDeserializer(buf); des.readHeader(); - - const ser = new v8.DefaultSerializer(); - ser.writeHeader(); - - ser.writeValue(des.readValue()); - - assert.deepStrictEqual(buf, ser.releaseBuffer()); assert.strictEqual(des.getWireFormatVersion(), 0x0d); + + const value = des.readValue(); + assert.strictEqual(value, value.foo); } {