From 0f2d882ab42fc07978dad4b65f8d08ff519c3b2b Mon Sep 17 00:00:00 2001 From: Mitsunee <19474909+Mitsunee@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:50:34 +0100 Subject: [PATCH] add: test cases for padStr with length smaller or equal to string length --- tests/padStr.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/padStr.test.ts b/tests/padStr.test.ts index 0b03642..4d81c0c 100644 --- a/tests/padStr.test.ts +++ b/tests/padStr.test.ts @@ -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();