Add more tests

This commit is contained in:
Simon Warta 2022-06-27 10:31:19 +02:00
parent 9545245267
commit ce7d3bf461

View File

@ -33,6 +33,12 @@ describe("Decimal", () => {
});
it("throws for atomics that are not non-negative integers", () => {
expect(() => Decimal.fromAtomics("0xAA", 0)).toThrowError(
"Invalid string format. Only non-negative integers in decimal representation supported.",
);
expect(() => Decimal.fromAtomics("", 0)).toThrowError(
"Invalid string format. Only non-negative integers in decimal representation supported.",
);
expect(() => Decimal.fromAtomics("-1", 0)).toThrowError(
"Invalid string format. Only non-negative integers in decimal representation supported.",
);