Skip to content

Commit

Permalink
Test boxed PIDs deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bartblast committed Oct 19, 2024
1 parent 8940a65 commit a509461
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 @@ -159,6 +159,29 @@ describe("Deserializer", () => {
assert.deepStrictEqual(deserialize(serialized, false), map);
});
});

describe("pid", () => {
const pid = Type.pid('my_node@my_"host', [0, 11, 222], "client");

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

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

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

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

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

assert.deepStrictEqual(deserialize(serialized, false), pid);
});
});
});
});
});

0 comments on commit a509461

Please sign in to comment.