Skip to content

Commit

Permalink
Test JS booleans deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bartblast committed Oct 19, 2024
1 parent 492253c commit cde6024
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/javascript/deserializer_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,29 @@ describe("Deserializer", () => {
assert.equal(deserialize(serialized, false), bigint);
});
});

describe("boolean", () => {
const boolean = true;

it("top-level", () => {
const serialized = serialize(boolean);

assert.equal(deserialize(serialized), boolean);
});

it("nested", () => {
const term = {a: boolean, b: 2};
const serialized = serialize(term);

assert.deepStrictEqual(deserialize(serialized), term);
});

it("not versioned", () => {
const serialized = serialize(boolean, true, false);

assert.equal(deserialize(serialized, false), boolean);
});
});
});
});
});

0 comments on commit cde6024

Please sign in to comment.