relocate a test

main
Matthew Butterick 10 years ago
parent 9a0e630517
commit 88da8d8440

@ -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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@ -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

Loading…
Cancel
Save