Skip to content

Commit

Permalink
add: test cases for padStr with length smaller or equal to string length
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitsunee committed Nov 20, 2024
1 parent d11b45d commit 0f2d882
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/padStr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@ test("padding centered", () => {
is(padStr("foo", 6, "center", "right"), " foo ", "test with right bias");
});

test("padding skipped", () => {
is(padStr("foo", 3, "left"), "foo", "test with length = string length");
is(
padStr("foobar", 3, "left"),
"foobar",
"test with length smaller than string length"
);
});

test.run();

0 comments on commit 0f2d882

Please sign in to comment.