From 83b5dba83c172c9413712286b6f7ff853f152da2 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 15 May 2015 19:34:48 -0700 Subject: [PATCH] correct tests --- quad/main-typed-tests.rkt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/quad/main-typed-tests.rkt b/quad/main-typed-tests.rkt index 90f23f08..7539dc36 100644 --- a/quad/main-typed-tests.rkt +++ b/quad/main-typed-tests.rkt @@ -4,22 +4,24 @@ (check-equal? (input->nested-blocks (input '() (block '() "1" (block-break) "2"))) - (list (list (list (list (quad 'word '#hash() '("1"))) (list (quad 'word '#hash() '("2"))))))) -(check-equal? (input->nested-blocks (input #f (block #f "1" (column-break) "2"))) - (list (list (list (list (quad 'word '#hash() '("1")))) (list (list (quad 'word '#hash() '("2"))))))) -(check-equal? (list (list (list (list (quad 'word '#hash() '("1"))))) (list (list (list (quad 'word '#hash() '("2")))))) -(input->nested-blocks (input #f (block #f "1" (page-break) "2")))) + (list (list (list (list (word '() "1")) (list (word '() "2")))))) -(check-equal? (merge-adjacent-within (line #f (word #f "b") (word #f "a") (word #f "r"))) (line #f (word #f "bar"))) +(check-equal? (input->nested-blocks (input '() (block '() "1" (column-break) "2"))) + (list (list (list (list (word '() "1"))) (list (list (word '() "2")))))) -(check-equal? (hyphenate-quad-except-last-word (line #f "snowman" "snowman")) (line #f "snow\u00ADman" "snowman")) -(define al-test-line (line (list world:line-looseness-key 42.0) (word #f "bar"))) -(define al-test-line2 (line (list world:line-looseness-key 30.0) (word #f "bar"))) +(check-equal? (list (list (list (list (word '() "1")))) (list (list (list (word '() "2"))))) +(input->nested-blocks (input '() (block '() "1" (page-break) "2")))) + +(check-equal? (merge-adjacent-within (line '() (word '() "b") (word '() "a") (word '() "r"))) (line '() (word '() "bar"))) + +(check-equal? (hyphenate-quad-except-last-word (box '() "snowman" "snowman")) (box '() "snow\u00ADman" "snowman")) + +(define al-test-line (line (list world:line-looseness-key 42.0) (word '() "bar"))) +(define al-test-line2 (line (list world:line-looseness-key 30.0) (word '() "bar"))) (check-equal? (average-looseness (list)) 0.0) ; default value for no lines (check-equal? (average-looseness (list al-test-line)) 0.0) ; default value for one line (check-equal? (average-looseness (list al-test-line al-test-line2)) 42.0) ; last line excluded by default (check-equal? (average-looseness (list al-test-line al-test-line2 al-test-line)) 36.0) ; last line excluded by default - -(check-equal? (log-debug-lines (list (line (list world:line-looseness-key 42.0) (word #f "bar")))) '("0/1: \"bar\" 42.0")) +(check-equal? (log-debug-lines (list (line (list world:line-looseness-key 42.0) (word '() "bar")))) '("0/1: \"bar\" 42.0"))