add another test case for stripAnsi

This commit is contained in:
Daylin Morgan 2024-09-30 13:38:35 -05:00
parent d852761831
commit efaf252305
Signed by: daylin
GPG key ID: 950D13E9719334AD
2 changed files with 3 additions and 1 deletions

View file

@ -19,6 +19,7 @@ func stripAnsi*(s: string): string =
while s[i] != 'm': while s[i] != 'm':
inc i inc i
inc i inc i
if i < s.len:
result.add s[i] result.add s[i]
inc i inc i

View file

@ -66,6 +66,7 @@ suite "basic":
suite "strutils": suite "strutils":
test "stripAnsi": test "stripAnsi":
check stripAnsi($bb"[red]red!") == "red!"
check stripAnsi("\e[1mBold String!") == "Bold String!" check stripAnsi("\e[1mBold String!") == "Bold String!"
test "&": test "&":