From 4f7e5fc0572f6533500c6b916db3020e1c3ed67c Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 3 Feb 2015 18:48:20 -0800 Subject: [PATCH] werk --- quad/tests-typed.rkt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/quad/tests-typed.rkt b/quad/tests-typed.rkt index eebced5f..dcf255b3 100644 --- a/quad/tests-typed.rkt +++ b/quad/tests-typed.rkt @@ -70,3 +70,17 @@ (check-equal? (quad-first-char (box #f (box #f "foo") "bar")) "f") (check-equal? (quad-first-char (box #f "foo")) "f") (check-false (quad-first-char (box))) + +(check-equal? (quad->string (box '(width 100) "foo")) "foo") +(check-equal? (quad->string (box '(width 100) "foo" (box '(width 100) "bar"))) "foobar") +(check-equal? (quad->string (box '(width 100) "foo" (box '(width 100) "bar") "ino")) "foobarino") +(check-equal? (quad->string (box '(width 100))) "") + +(check-false (whitespace? (~a #\u00A0))) +(check-true (whitespace/nbsp? (~a #\u00A0))) +(check-true (whitespace/nbsp? (word #f (~a #\u00A0)))) +(check-false (whitespace? (format " ~a " #\u00A0))) +(check-true (whitespace/nbsp? (format " ~a " #\u00A0))) +(define funny-unicode-spaces (map ~a (list #\u2000 #\u2007 #\u2009 #\u200a #\u202f))) +(check-true (andmap whitespace? funny-unicode-spaces)) +(check-true (andmap whitespace/nbsp? funny-unicode-spaces)) \ No newline at end of file