diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-01-30 14:34:53 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-01-30 14:34:53 +0200 |
| commit | 3fbe17312a7b1474b290c129ebeca9ee7c773c6e (patch) | |
| tree | ec80a2805fe2b4e64563219483e44fdc1b5697b9 /samples/testing.sample | |
| parent | 477579b5e8c7297efefc1ccabf8ead7c024ac4dc (diff) | |
Add string interpolation sugar
Diffstat (limited to 'samples/testing.sample')
| -rw-r--r-- | samples/testing.sample | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/samples/testing.sample b/samples/testing.sample index d57a7a7..f9352cd 100644 --- a/samples/testing.sample +++ b/samples/testing.sample @@ -11,7 +11,9 @@ define init-tests -- print ok, fail counter values define end-tests - '[ $ok-count @ reprup " ok, " up $fail-count @ reprup " failed" up '] p s. + $ok-count @ repr + $fail-count @ repr + "%% ok, %% failed" s. $ok-count forget $fail-count forget ; @@ -29,9 +31,14 @@ define assert-eq $actualp ! $actualp @ up $actualv ! $expected @ $actualv @ eq? - [ '[ $actualp @ reprup " == " up $expected @ reprup " 👍" up '] p s. + [ $actualp @ repr + $expected @ repr + "%% == %% 👍" s. $ok-count increment ] - [ '[ $actualp @ reprup " == " up $expected @ reprup " ❌" up ", actual: " up $actualv @ reprup '] p s. + [ $actualp @ repr + $expected @ repr + $actualv @ repr + "%% == %% ❌, actual: %%" s. $fail-count increment ] cond $expected forget $actualp forget $actualv forget |
