mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2024-12-22 03:00:43 -06:00
add another test case for stripAnsi
This commit is contained in:
parent
d852761831
commit
efaf252305
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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 "&":
|
||||||
|
|
Loading…
Reference in a new issue