Some more tests for bos/eos.
This commit is contained in:
parent
35e91dcfd2
commit
a48b4c18a4
|
@ -362,16 +362,22 @@
|
||||||
(add-rx-test
|
(add-rx-test
|
||||||
(lambda (regexp str/lst result)
|
(lambda (regexp str/lst result)
|
||||||
(let ((str (if (string? str/lst) str/lst (list->string str/lst)))
|
(let ((str (if (string? str/lst) str/lst (list->string str/lst)))
|
||||||
(name (format #f "regexp-search?-test-~d" count)))
|
(name (format #f "e/bos-regexp-search?-test-~d" count)))
|
||||||
(set! count (+ 1 count))
|
(set! count (+ 1 count))
|
||||||
(add-test! (string->symbol name) 'pattern-matching
|
(add-test! (string->symbol name) 'pattern-matching
|
||||||
(lambda () (equal? (regexp-search? regexp str) result))))))
|
(lambda () (equal? (regexp-search? regexp str) result))))))
|
||||||
(blank-rx (rx bos (* white) #\newline eos)))
|
(blank-rx (rx bos (* white) #\newline eos))
|
||||||
(add-rx-test blank-rx "abcd\na" #f)
|
(start-with-a (rx bos "a"))
|
||||||
|
(end-with-b (rx "b" eos)))
|
||||||
|
(add-rx-test (rx eos) "anything" #t)
|
||||||
|
(add-rx-test (rx bos) "really anything" #t)
|
||||||
(add-rx-test blank-rx '(#\newline) #t)
|
(add-rx-test blank-rx '(#\newline) #t)
|
||||||
(add-rx-test blank-rx '(#\newline #\newline) #t)
|
(add-rx-test blank-rx '(#\newline #\newline) #t)
|
||||||
(add-rx-test blank-rx '(#\space #\space #\newline) #t)
|
(add-rx-test blank-rx '(#\space #\space #\newline) #t)
|
||||||
(add-rx-test blank-rx "\t \t \n\n" #t))
|
(add-rx-test blank-rx "\t \t \n\n" #t)
|
||||||
|
(add-rx-test start-with-a "a haha \n\t" #t)
|
||||||
|
(add-rx-test start-with-a "ahora" #t)
|
||||||
|
(add-rx-test end-with-b "blurb" #t))
|
||||||
|
|
||||||
(add-test! 'regexp-substitute/global-test-1 'pattern-matching
|
(add-test! 'regexp-substitute/global-test-1 'pattern-matching
|
||||||
(lambda ()
|
(lambda ()
|
||||||
|
|
Loading…
Reference in New Issue