mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
test(encoding): improve test coverage (#4742)
This commit is contained in:
parent
48506f42c6
commit
aa35b3574f
@ -110,6 +110,7 @@ Deno.test({
|
|||||||
fn() {
|
fn() {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
() => decodeBase32("OOOO=="),
|
() => decodeBase32("OOOO=="),
|
||||||
|
Error,
|
||||||
"Invalid string. Length must be a multiple of 8",
|
"Invalid string. Length must be a multiple of 8",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -119,7 +120,8 @@ Deno.test({
|
|||||||
name: "decodeBase32() throws on bad padding",
|
name: "decodeBase32() throws on bad padding",
|
||||||
fn() {
|
fn() {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
() => decodeBase32("OOOO=="),
|
() => decodeBase32("5HXR334AQYAAAA=="),
|
||||||
|
Error,
|
||||||
"Invalid pad length",
|
"Invalid pad length",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -67,6 +67,7 @@ Deno.test("decodeBase58() decodes binary", () => {
|
|||||||
Deno.test("decodeBase58() throws on invalid input", () => {
|
Deno.test("decodeBase58() throws on invalid input", () => {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
() => decodeBase58("+2NEpo7TZRRrLZSi2U"),
|
() => decodeBase58("+2NEpo7TZRRrLZSi2U"),
|
||||||
|
Error,
|
||||||
`Invalid base58 char at index 0 with value +`,
|
`Invalid base58 char at index 0 with value +`,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user