Skip to content

Commit

Permalink
test(encoding): improve test coverage (#4742)
Browse files Browse the repository at this point in the history
  • Loading branch information
babiabeo authored May 15, 2024
1 parent 48506f4 commit aa35b35
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion encoding/base32_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Deno.test({
fn() {
assertThrows(
() => decodeBase32("OOOO=="),
Error,
"Invalid string. Length must be a multiple of 8",
);
},
Expand All @@ -119,7 +120,8 @@ Deno.test({
name: "decodeBase32() throws on bad padding",
fn() {
assertThrows(
() => decodeBase32("OOOO=="),
() => decodeBase32("5HXR334AQYAAAA=="),
Error,
"Invalid pad length",
);
},
Expand Down
1 change: 1 addition & 0 deletions encoding/base58_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Deno.test("decodeBase58() decodes binary", () => {
Deno.test("decodeBase58() throws on invalid input", () => {
assertThrows(
() => decodeBase58("+2NEpo7TZRRrLZSi2U"),
Error,
`Invalid base58 char at index 0 with value +`,
);
});

0 comments on commit aa35b35

Please sign in to comment.