From f35da4cfaacc02901f18e334dc9d27d194b93548 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Thu, 5 Dec 2013 23:41:56 -0500 Subject: [PATCH] Add tests for some recent base type additions (cherry picked from commit 78820bda4528ca100524d5007cf46905d039803d) --- .../unit-tests/typecheck-tests.rkt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index a3925076b3..01c68ad82f 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -1851,6 +1851,41 @@ [tc-e (hash-ref (ann (make-hash) (HashTable #f #t)) #f #f) -Boolean] + + ;; regexp-replaces + [tc-e + (regexp-replaces "zero-or-more?" '([#rx"-" "_"] [#rx"(.*)\\?$" "is_\\1"])) + (t:Un -String -Bytes)] + [tc-e + (regexp-replaces "zero-or-more?" '(["e" "o"] ["o" "oo"])) + (t:Un -String -Bytes)] + + ;; racket/string + [tc-e + (string-append* "a" '("c" "d")) + -String] + [tc-e + (string-append* (cdr (append* (map (λ: ([x : String]) (list ", " x)) + '("Alpha" "Beta" "Gamma"))))) + -String] + [tc-e + (string-join '("x" "y" "z") ", " + #:before-first "Todo: " + #:before-last " and " + #:after-last ".") + -String] + [tc-e + (string-normalize-spaces " foo bar baz \r\n\t") + -String] + [tc-e + (string-replace "foo bar baz" "bar" "blah") + -String] + [tc-e + (string-split " " #:trim? #f) + (-lst -String)] + [tc-e + (string-trim " foo bar baz \r\n\t" " " #:repeat? #t) + -String] ) (test-suite "tc-literal tests"