D'oh! String normalization tests were broken, which explains why they pass.
authorChris Hanson <org/chris-hanson/cph>
Sun, 19 Mar 2017 20:20:31 +0000 (13:20 -0700)
committerChris Hanson <org/chris-hanson/cph>
Sun, 19 Mar 2017 20:20:31 +0000 (13:20 -0700)
tests/runtime/test-string-normalization.scm

index 68eb58ad058f386b1658febdba1390f746c20bf8..6387cc863ec8198c803e73815db0a4162225c457 100644 (file)
@@ -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))