diff options
| author | 2022-05-06 15:15:34 -0500 | |
|---|---|---|
| committer | 2022-05-06 15:16:25 -0500 | |
| commit | 101b83658ee37b08c23a032997ca3db2d69435a1 (patch) | |
| tree | da25c48bc002fc0b0a3c7a9a0fa3edceeacaeb4d /test | |
| parent | Merge pull request #60 from paulsnar/paulsnar/http (diff) | |
Make test suite handle /r in templates.
Also make test output much less verbose.
Diffstat (limited to 'test')
| -rw-r--r-- | test/suite0008.janet | 7 | ||||
| -rw-r--r-- | test/suite0010.janet | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/test/suite0008.janet b/test/suite0008.janet index edcb1ee..4e35456 100644 --- a/test/suite0008.janet +++ b/test/suite0008.janet @@ -5,13 +5,16 @@ (test/start-suite 8) +(defn- remove-r [x] (string/replace-all "\r" "" x)) + (defn check-template [template args expected] + (def expected (string/trim (remove-r expected))) (def buf @"") (with-dyns [:out buf] (template args)) - (def sbuf (string/trim (string buf))) - (test/assert (= sbuf expected) (string "Render of " template))) + (def sbuf (string/trim (remove-r (string buf)))) + (test/assert (= sbuf expected) (string/format "template %v - expected %v, got %v" template expected sbuf))) (import ./templates/hi :as hi) (import ./templates/hop :as hop) diff --git a/test/suite0010.janet b/test/suite0010.janet index 05e58d9..6eab5c1 100644 --- a/test/suite0010.janet +++ b/test/suite0010.janet @@ -10,6 +10,4 @@ (eu/pcall (fn workerf [i] (+= x i)) 10) (assert (= x 45) "pcall 2") - - (end-suite) |
