hwylterm/tests/tcli.nim

18 lines
440 B
Nim
Raw Normal View History

2024-09-17 17:28:21 -05:00
import std/[
unittest
]
2024-09-30 17:23:52 -05:00
import hwylterm, hwylterm/cli
2024-09-17 17:28:21 -05:00
suite "cli":
2024-09-30 17:23:52 -05:00
test "cli":
let expected = """[b]test-program[/] [[args...]
[b cyan]flags[/]:
[yellow]-h[/] [magenta]--help [/] []show this help[/]
[yellow]-V[/] [magenta]--version[/] []print version[/]
"""
let cli = newHwylCli("[b]test-program[/] [[args...]",flags = [("h","help","show this help",),("V","version","print version")])
check $cli == $bb(expected)