Skip to content

Commit 08c192e

Browse files
committed
Added more testscases
1 parent 7da65c5 commit 08c192e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib/string.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ describe("string tests", () => {
127127
["hello world", "hello world", ""],
128128
["hello world", " ", "hello world"],
129129
[" hello world", " ", "hello world"],
130+
["hello world hello world", "hello world", " hello world"],
131+
["hello worldhello world", "hello world", ""],
130132
])("left trim", (haystack, needle, expected) => {
131133
expect(trimStart(haystack, needle)).toBe(expected);
132134
});
@@ -137,6 +139,8 @@ describe("string tests", () => {
137139
["hello world", "hello world", ""],
138140
["hello world ", " ", "hello world"],
139141
["hello world", " ", "hello world"],
142+
["hello world hello world", "hello world", "hello world "],
143+
["hello worldhello world", "hello world", ""],
140144
])("right trim", (haystack, needle, expected) => {
141145
expect(trimEnd(haystack, needle)).toBe(expected);
142146
});

0 commit comments

Comments
 (0)