From f10076f8ab79e71a40ad47f09a3aa1d246decfb3 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 19 Mar 2017 13:20:31 -0700 Subject: [PATCH] D'oh! String normalization tests were broken, which explains why they pass. --- tests/runtime/test-string-normalization.scm | 33 ++++++++++++++------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/tests/runtime/test-string-normalization.scm b/tests/runtime/test-string-normalization.scm index 68eb58ad0..6387cc863 100644 --- a/tests/runtime/test-string-normalization.scm +++ b/tests/runtime/test-string-normalization.scm @@ -93709,18 +93709,31 @@ USA. (define (run-nfd-test tc) (with-test-properties (lambda () - (assert (string->nfd (norm-tc-source tc)) - (norm-tc-nfd tc)) - (assert (string->nfd (norm-tc-nfc tc)) - (norm-tc-nfd tc)) - (assert (string->nfd (norm-tc-nfd tc)) - (norm-tc-nfd tc)) - (assert (string->nfd (norm-tc-nfkc tc)) - (norm-tc-nfkd tc)) - (assert (string->nfd (norm-tc-nfkd tc)) - (norm-tc-nfkd tc))) + (assert-ts= (string->nfd (norm-tc-source tc)) + (norm-tc-nfd tc)) + (assert-ts= (string->nfd (norm-tc-nfc tc)) + (norm-tc-nfd tc)) + (assert-ts= (string->nfd (norm-tc-nfd tc)) + (norm-tc-nfd tc)) + (assert-ts= (string->nfd (norm-tc-nfkc tc)) + (norm-tc-nfkd tc)) + (assert-ts= (string->nfd (norm-tc-nfkd tc)) + (norm-tc-nfkd tc))) 'expression `(nfd-test ,tc))) +(define (trivial-string=? s1 s2) + (let ((n (string-length s1))) + (and (fix:= n (string-length s2)) + (let loop ((i 0)) + (if (fix:< i n) + (and (char=? (string-ref s1 i) + (string-ref s2 i)) + (loop (fix:+ i 1))) + #t))))) + +(define-comparator trivial-string=? 'trivial-string=?) +(define assert-ts= (simple-binary-assertion trivial-string=? #f)) + (define (norm-tc-source tc) (car tc)) -- 2.25.1