From a48b4c18a499e4288526b74a4cd684e6917ffffd Mon Sep 17 00:00:00 2001 From: jaortega Date: Fri, 15 Feb 2008 23:33:45 +0000 Subject: [PATCH] Some more tests for bos/eos. --- scsh/test/pattern-matching-test.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scsh/test/pattern-matching-test.scm b/scsh/test/pattern-matching-test.scm index 51a7966..6e7b3fe 100644 --- a/scsh/test/pattern-matching-test.scm +++ b/scsh/test/pattern-matching-test.scm @@ -362,16 +362,22 @@ (add-rx-test (lambda (regexp str/lst result) (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)) (add-test! (string->symbol name) 'pattern-matching (lambda () (equal? (regexp-search? regexp str) result)))))) - (blank-rx (rx bos (* white) #\newline eos))) - (add-rx-test blank-rx "abcd\na" #f) + (blank-rx (rx bos (* white) #\newline eos)) + (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 #\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 (lambda ()