import { JSON } from "json-as"; import { describe, expect, run } from "as-test/assembly"; describe("Should serialize integers", () => { expect(JSON.stringify(0)).toBe("0"); expect(JSON.stringify(100)).toBe("100"); expect(JSON.stringify(101)).toBe("101"); expect(JSON.stringify(-100)).toBe("-100"); expect(JSON.stringify(-101)).toBe("-101"); }); describe("Should deserialize integers", () => { expect(JSON.parse("0")).toBe(0); expect(JSON.parse("100")).toBe(100); expect(JSON.parse("101")).toBe(101); expect(JSON.parse("-100")).toBe(-100); expect(JSON.parse("-101")).toBe(-101); }); run();