Skip to content

Commit

Permalink
Test JS floats deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bartblast committed Oct 24, 2024
1 parent 0a505ed commit 2982907
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 @@ -299,6 +299,29 @@ describe("Deserializer", () => {
assert.equal(deserialize(serialized, false), boolean);
});
});

describe("float", () => {
const float = 1.23;

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

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

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

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

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

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

0 comments on commit 2982907

Please sign in to comment.