Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix prints in test-by-example

  • Loading branch information...
commit adf2448424ad5759dcba19053c2b1786786ecc31 1 parent 7f628de
Andrew Wilcox awwx authored
2  capture.arc
View
@@ -3,7 +3,7 @@
(def capture-out (f)
(let out (tostring (f))
(if (> len.out 0)
- `((out ,out)))))
+ `((prints ,out)))))
(def capture-errout (f)
(let errout (w/outstring s
8 capture.t
View
@@ -3,7 +3,7 @@
(example-test (runtime '(capture)) #<<.
> (capture-out (fn () (pr "xyz")))
-((out "xyz"))
+((prints "xyz"))
> (capture-errout (fn () (ero "foo")))
((errout "\"foo\" \n"))
@@ -18,7 +18,7 @@
(pr "xyz")
(ero 'ignored)
123))
-((val 123) (out "xyz"))
+((val 123) (prints "xyz"))
> (capture-val-out-errout (fn () 123))
((val 123))
@@ -27,13 +27,13 @@
(pr "xyz")
(ero 'foo)
123))
-((val 123) (out "xyz") (errout "foo \n"))
+((val 123) (prints "xyz") (errout "foo \n"))
> (capture-val-out-errout (fn ()
(pr "abc")
(ero 'def)
(err "foo")))
-((err "foo") (out "abc") (errout "def \n"))
+((err "foo") (prints "abc") (errout "def \n"))
.
)
3  test-by-example.arc
View
@@ -95,7 +95,8 @@
(let actual-value-assoc (assoc key actual)
(if (no actual-value-assoc)
(throw (+ "expected " key " " (tostring:write expected-value) ", "
- "not present in actual result"))
+ "not present in actual result: "
+ (tostring:write actual)))
(let actual-value (cadr actual-value-assoc)
(if (isnt (trim expected-value 'end)
(trim actual-value 'end))
6 test-by-example.t
View
@@ -157,3 +157,9 @@ prints: hi\n
#<fn:+>
.
)
+
+(example-test runtime* #<<.
+> (pr "foo")
+prints: foo
+.
+)
Please sign in to comment.
Something went wrong with that request. Please try again.