Skip to content

Commit

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

describe("port", () => {
const port = Type.port("0.11", "client");

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

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

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

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

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

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

0 comments on commit 0acb822

Please sign in to comment.