mirror of
https://github.com/daylinmorgan/hwylterm.git
synced 2025-02-23 01:35:50 -06:00
add compiletime test
This commit is contained in:
parent
7f37590184
commit
8340e76424
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,7 @@ bbMode = On
|
|||
template bbCheck(input: string, output: string): untyped =
|
||||
check escape($bb(input)) == escape(output)
|
||||
|
||||
|
||||
suite "basic":
|
||||
test "simple":
|
||||
bbCheck "[red][/red]", ""
|
||||
|
@ -16,6 +17,10 @@ suite "basic":
|
|||
bbCheck "[red]5[/]", "\e[38;5;1m5\e[0m"
|
||||
bbCheck "[bold][red]5","\e[1;38;5;1m5\e[0m"
|
||||
|
||||
test "compile time":
|
||||
const s = bb"[red]red text"
|
||||
check s == bb"[red]red text"
|
||||
|
||||
test "closing":
|
||||
bbCheck "[bold]Bold[red] Bold Red[/red] Bold Only",
|
||||
"\e[1mBold\e[0m\e[1;38;5;1m Bold Red\e[0m\e[1m Bold Only\e[0m"
|
||||
|
@ -102,3 +107,4 @@ suite "strutils":
|
|||
check bb"[red]red[/]yellow" == y
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue