mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +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 ()
|
(syntax-rules ()
|
||||||
((log->string/no-dates expr ...)
|
((log->string/no-dates expr ...)
|
||||||
(string-join
|
(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"))
|
(string-split (log->string expr ...) "\n"))
|
||||||
"\n"))))
|
"\n"))))
|
||||||
(define (run-tests)
|
(define (run-tests)
|
||||||
(test-begin "logging")
|
(test-begin "logging")
|
||||||
(test "D four: 4"
|
(test "D four: 4\n"
|
||||||
(log->string/no-dates
|
(log->string/no-dates
|
||||||
(log-debug "four: " (+ 2 2))))
|
(log-debug "four: " (+ 2 2))))
|
||||||
(test "I pi: 3.14"
|
(test "I pi: 3.14\n"
|
||||||
(log->string/no-dates
|
(log->string/no-dates
|
||||||
(log-info "pi: " (with ((precision 2)) (acos -1)))))
|
(log-info "pi: " (with ((precision 2)) (acos -1)))))
|
||||||
(test-assert
|
(test-assert
|
||||||
(string-prefix? "E "
|
(string-prefix? "E "
|
||||||
(log->string/no-dates
|
(log->string/no-dates
|
||||||
(with-logged-errors (/ 1 0)))))
|
(with-logged-errors (/ 1 0)))))
|
||||||
(test "W warn\nE error"
|
(test "W warn\nE error\n"
|
||||||
(log->string/no-dates
|
(log->string/no-dates
|
||||||
(with-log-level
|
(with-log-level
|
||||||
'warn
|
'warn
|
||||||
|
|
Loading…
Add table
Reference in a new issue