From ce7d3bf4613d25ff4966a920701256bcefefd5c2 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 27 Jun 2022 10:31:19 +0200 Subject: [PATCH] Add more tests --- packages/math/src/decimal.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/math/src/decimal.spec.ts b/packages/math/src/decimal.spec.ts index a37783913b..dcefcad388 100644 --- a/packages/math/src/decimal.spec.ts +++ b/packages/math/src/decimal.spec.ts @@ -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.", );