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,7 +19,8 @@ func stripAnsi*(s: string): string =
while s[i] != 'm':
inc i
inc i
result.add s[i]
if i < s.len:
result.add s[i]
inc i
type

View file

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