From 88da8d84403484891c36511da289673b735e32f4 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 14 Feb 2014 07:54:18 -0800 Subject: [PATCH] relocate a test --- hyphenate/main.rkt | 9 --------- hyphenate/tests.rkt | 12 +++++++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/hyphenate/main.rkt b/hyphenate/main.rkt index 6fac8aef..3d7d2289 100644 --- a/hyphenate/main.rkt +++ b/hyphenate/main.rkt @@ -2,8 +2,6 @@ (require racket/string racket/list racket/contract racket/vector) (require "patterns.rkt" "exceptions.rkt") -(module+ test (require rackunit)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Hyphenate module ;;; Racket port of Ned Batchelder's hyphenate.py @@ -48,13 +46,6 @@ (define (exception-word? x) (if (regexp-match #px"^[\\w-]+$" x) #t #f)) -(module+ test - (check-true (exception-word? "Foobar")) - (check-true (exception-word? "foobar")) - (check-false (exception-word? "foobar!")) - (check-true (exception-word? "foo-bar")) - (check-false (exception-word? "foo bar"))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Helper functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/hyphenate/tests.rkt b/hyphenate/tests.rkt index 143ac860..37aeeede 100644 --- a/hyphenate/tests.rkt +++ b/hyphenate/tests.rkt @@ -1,9 +1,16 @@ #lang racket/base -(require "main.rkt") - (require rackunit) +(require "main.rkt") + (require/expose "main.rkt" (word->hyphenation-points)) +(require/expose "main.rkt" (exception-word?)) + +(check-true (exception-word? "Foobar")) +(check-true (exception-word? "foobar")) +(check-false (exception-word? "foobar!")) +(check-true (exception-word? "foo-bar")) +(check-false (exception-word? "foo bar")) (check-equal? (hyphenate "polymorphism") "poly\u00ADmor\u00ADphism") (check-equal? (hyphenate "polymorphism" #:min-length 100) "polymorphism") @@ -19,4 +26,3 @@ ;; test these last so exceptions have been set up already (check-equal? (word->hyphenation-points "polymorphism") '("poly" "mor" "phism")) (check-equal? (word->hyphenation-points "present") '("present")) ; exception word -