(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))