Skip to content

Commit

Permalink
fix test verbosity for monad/parsec
Browse files Browse the repository at this point in the history
  • Loading branch information
drewc committed Aug 31, 2024
1 parent 667855b commit f6758b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/std/monad-test.ss
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
((_ test-case: name rest ...)
#'(test-case name (test-inline rest ...)))
((_ > form > rest ...)
#'(begin (displayln "... " 'form) form (test-inline > rest ...)))
#'(begin (when *test-versbose* (displayln "... " 'form)) form (test-inline > rest ...)))
((_ > test result rest ...)
#'(begin (check test => 'result) (test-inline rest ...)))
((_) #!void)))

(set-test-verbose! #t)
;; (set-test-verbose! #t)

(def monad-test
(test-suite "Test :std/monad"
Expand Down
4 changes: 2 additions & 2 deletions src/std/monad/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -1130,12 +1130,12 @@ This is after state in the train of thought so is defined here.
((_ test-case: name rest ...)
#'(test-case name (test-inline rest ...)))
((_ > form > rest ...)
#'(begin (displayln "... " 'form) form (test-inline > rest ...)))
#'(begin (when std/test#*test-versbose* (displayln "... " 'form)) form (test-inline > rest ...)))
((_ > test result rest ...)
#'(begin (check test => 'result) (test-inline rest ...)))
((_) #!void)))

(set-test-verbose! #t)
;; (set-test-verbose! #t)

(def monad-test
(test-suite "Test :std/monad"
Expand Down
13 changes: 7 additions & 6 deletions src/std/parsec-test.ss
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
((_ test-case: name rest ...)
#'(test-case name (test-inline rest ...)))
((_ > form > rest ...)
#'(begin (displayln "... " 'form) form (test-inline > rest ...)))
#'(begin (when std/test#*test-verbose* (displayln "... " 'form)) form (test-inline > rest ...)))
((_ > test result rest ...)
#'(begin (check test => 'result) (test-inline rest ...)))
((_) #!void)))

(set-test-verbose! #t)

;; (set-test-verbose! #f)
(def parsec-test
(test-suite "Test :std/parsec"
(test-inline
Expand Down Expand Up @@ -287,10 +287,11 @@
> (def-parse EOL (.or (.eof) (.newline)))

> (def-parse KEY
(.>> (.string "#+")
(.many-till
(.satisfy (? (not char-whitespace?)))
(.string ": "))))
(.>> (.string "#+")
(.many-till
(.satisfy (? (not char-whitespace?)))
(.string ": "))))

> (def-parse VALUE (.many-till (.any-token) EOL))

> (def-parse KEYWORD
Expand Down
5 changes: 3 additions & 2 deletions src/std/parsec/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ The first line is a keyword.
(.many-till
(.satisfy (? (not char-whitespace?)))
(.string ": "))))

> (def-parse VALUE (.many-till (.any-token) EOL))

> (def-parse KEYWORD
Expand Down Expand Up @@ -1058,13 +1059,13 @@ non-determanistic parsers that's a possibility!
((_ test-case: name rest ...)
#'(test-case name (test-inline rest ...)))
((_ > form > rest ...)
#'(begin (displayln "... " 'form) form (test-inline > rest ...)))
#'(begin (when std/test#*test-verbose* (displayln "... " 'form)) form (test-inline > rest ...)))
((_ > test result rest ...)
#'(begin (check test => 'result) (test-inline rest ...)))
((_) #!void)))

(set-test-verbose! #t)

;; (set-test-verbose! #f)
(def parsec-test
(test-suite "Test :std/parsec"
(test-inline
Expand Down

0 comments on commit f6758b5

Please sign in to comment.