From 52be6a23e3b087a179496083bef96a5b1c78ed27 Mon Sep 17 00:00:00 2001
From: Chris Hanson <org/chris-hanson/cph>
Date: Mon, 6 Mar 2017 16:33:42 -0800
Subject: [PATCH] Fix test, now that I understand what's going on.

---
 src/runtime/ustring.scm       | 5 ++++-
 tests/runtime/test-string.scm | 6 ++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm
index ab6c627b1..382080a9f 100644
--- a/src/runtime/ustring.scm
+++ b/src/runtime/ustring.scm
@@ -791,7 +791,7 @@ USA.
 	(if (fix:< i1 n)
 	    (let ((wb1 (get-wb i1)))
 	      (cond ((select:extender wb1)
-		     (t1-!breaker wb0 i1 ctx))
+		     (t1-!breaker (if (select:zwj wb0) wb1 wb0) i1 ctx))
 		    ((select:breaker wb1)
 		     (t1-breaker wb1 i1 (break i1 ctx)))
 		    (else
@@ -856,6 +856,9 @@ USA.
 (define select:extender
   (make-selector wb-names '(extend format zwj)))
 
+(define select:zwj
+  (make-selector wb-names '(zwj)))
+
 (define wb-states
   (make-vector (vector-length wb-names)
 	       (lambda (wb1 wb2 k1 k2)
diff --git a/tests/runtime/test-string.scm b/tests/runtime/test-string.scm
index 0feb721c5..3e12df3ef 100644
--- a/tests/runtime/test-string.scm
+++ b/tests/runtime/test-string.scm
@@ -2356,11 +2356,9 @@ USA.
 	 (#t #\x200D #t #\x1F3FB #t)
 	 (#t #\x200D #f #\x0308 #t #\x1F3FB #t)
 	 (#t #\x200D #f #\x2764 #t)
-	 ;; Not clear why this is correct:
-	 ;; (#t #\x200D #f #\x0308 #t #\x2764 #t)
+	 (#t #\x200D #f #\x0308 #t #\x2764 #t)
 	 (#t #\x200D #f #\x1F466 #t)
-	 ;; Not clear why this is correct:
-	 ;; (#t #\x200D #f #\x0308 #t #\x1F466 #t)
+	 (#t #\x200D #f #\x0308 #t #\x1F466 #t)
 	 (#t #\x200D #f #\x00AD #t)
 	 (#t #\x200D #f #\x0308 #f #\x00AD #t)
 	 (#t #\x200D #f #\x0300 #t)
-- 
2.25.1