diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 17:44:08 -0400 |
| commit | c941b9a3325228eba404455afea7ccea0da45095 (patch) | |
| tree | d4ca88c6848ac2e6ceee635bb87add87ba6d2322 /test/lang.tm | |
| parent | 1cec086a6034ad546977cae7aeaf4bb876d21970 (diff) | |
Fix tests
Diffstat (limited to 'test/lang.tm')
| -rw-r--r-- | test/lang.tm | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/test/lang.tm b/test/lang.tm index 21b70f96..9db69dbe 100644 --- a/test/lang.tm +++ b/test/lang.tm @@ -22,34 +22,25 @@ struct Bold(text:Text) return $HTML"<b>$(b.text)</b>" func main() - >> HTML.HEADER - = $HTML"<!DOCTYPE HTML>" + assert HTML.HEADER == $HTML"<!DOCTYPE HTML>" - >> HTML.HEADER[1] - = $HTML"<" + assert HTML.HEADER[1] == $HTML"<" - >> HTML.HEADER.text - = "<!DOCTYPE HTML>" + assert HTML.HEADER.text == "<!DOCTYPE HTML>" >> user := "I <3 hax" - >> html := $HTML"Hello $user!" - = $HTML"Hello I <3 hax!" - >> html ++ $HTML"<br>" - = $HTML"Hello I <3 hax!<br>" + html := $HTML"Hello $user!" + assert html == $HTML"Hello I <3 hax!" + assert html ++ $HTML"<br>" == $HTML"Hello I <3 hax!<br>" - >> $HTML"$(1 + 2)" - = $HTML"3" + assert $HTML"$(1 + 2)" == $HTML"3" - >> $HTML"$(Int8(3))" - = $HTML"3" + assert $HTML"$(Int8(3))" == $HTML"3" - >> html.paragraph() - = $HTML"<p>Hello I <3 hax!</p>" + assert html.paragraph() == $HTML"<p>Hello I <3 hax!</p>" - >> Text(html) - = '\$HTML"Hello I <3 hax!"' + assert Text(html) == '\$HTML"Hello I <3 hax!"' >> b := Bold("Some <text> with junk") - >> $HTML"Your text: $b" - = $HTML"Your text: <b>Some <text> with junk</b>" + assert $HTML"Your text: $b" == $HTML"Your text: <b>Some <text> with junk</b>" |
