mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
update logging tests for fixes in string-split
This commit is contained in:
parent
8b27ce9726
commit
f7b546769c
1 changed files with 5 additions and 4 deletions
|
@ -16,22 +16,23 @@
|
|||
(syntax-rules ()
|
||||
((log->string/no-dates expr ...)
|
||||
(string-join
|
||||
(map (lambda (line) (substring line 20))
|
||||
(map (lambda (line)
|
||||
(if (string-null? line) line (substring line 20)))
|
||||
(string-split (log->string expr ...) "\n"))
|
||||
"\n"))))
|
||||
(define (run-tests)
|
||||
(test-begin "logging")
|
||||
(test "D four: 4"
|
||||
(test "D four: 4\n"
|
||||
(log->string/no-dates
|
||||
(log-debug "four: " (+ 2 2))))
|
||||
(test "I pi: 3.14"
|
||||
(test "I pi: 3.14\n"
|
||||
(log->string/no-dates
|
||||
(log-info "pi: " (with ((precision 2)) (acos -1)))))
|
||||
(test-assert
|
||||
(string-prefix? "E "
|
||||
(log->string/no-dates
|
||||
(with-logged-errors (/ 1 0)))))
|
||||
(test "W warn\nE error"
|
||||
(test "W warn\nE error\n"
|
||||
(log->string/no-dates
|
||||
(with-log-level
|
||||
'warn
|
||||
|
|
Loading…
Add table
Reference in a new issue