[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-commits
Subject:    [Sbcl-commits] master: Fix a test on -sb-unicode.
From:       stassats via Sbcl-commits <sbcl-commits () lists ! sourceforge ! net>
Date:       2019-09-29 11:33:32
Message-ID: 1569756813.9148.29120 () sfp-scm-8 ! v30 ! lw ! sourceforge ! com
[Download RAW message or body]

The branch "master" has been updated in SBCL:
       via  3085962e459597d2080b202a6b78a04ad7a33672 (commit)
      from  31acc6c221924c7b38ad7c2bc68e478ee40e6ac5 (commit)

- Log -----------------------------------------------------------------
commit 3085962e459597d2080b202a6b78a04ad7a33672
Author: Stas Boukarev <stassats@gmail.com>
Date:   Sun Sep 29 14:33:19 2019 +0300

    Fix a test on -sb-unicode.
---
 tests/unicode-breaking.pure.lisp | 42 +++++++++++++++++-----------------------
 1 file changed, 18 insertions(+), 24 deletions(-)

diff --git a/tests/unicode-breaking.pure.lisp b/tests/unicode-breaking.pure.lisp
index f17a37c40..8c439422a 100644
--- a/tests/unicode-breaking.pure.lisp
+++ b/tests/unicode-breaking.pure.lisp
@@ -100,29 +100,23 @@
      (split-string (remove +mul+ (remove +div+ string)) #\Space)
      :test #'string=)) 'string))
 
-(defvar *line-break-exceptions*
-  (let ((strings
-         (with-open-file (s "data/line-break-exceptions.lisp-expr" :external-format :utf-8)
-           (read s)))
-        (result (make-hash-table :test 'equal)))
-    (dolist (s strings result)
-      (setf (gethash s result) t))))
-
-(defun test-line-breaking ()
-  (declare (optimize (debug 2)))
-  (with-test (:name (:line-breaking)
-                    :skipped-on (not :sb-unicode))
+(with-test (:name (:line-breaking)
+            :skipped-on (not :sb-unicode))
+  (let* ((line-break-exceptions (make-hash-table :test 'equal))
+         (strings
+           (with-open-file (s "data/line-break-exceptions.lisp-expr" :external-format :utf-8)
+             (read s))))
+    (dolist (s strings)
+      (setf (gethash s line-break-exceptions) t))
     (with-open-file (s "data/LineBreakTest.txt" :external-format :utf8)
       (loop for line = (read-line s nil nil)
-         while line
-         do (let ((string (subseq line 0 (max 0 (1- (or (position #\# line) 1))))))
-              (unless (string= string "")
-                (let* ((expected (process-line-break-line string))
-                       (annotated (sb-unicode::line-break-annotate
-                                   (string-from-line-break-line string)))
-                       (actual (substitute :can :must annotated)))
-                  (if (gethash string *line-break-exceptions*)
-                      (assert (not (equal expected actual)))
-                      (assert (equal expected actual))))))))))
-
-(test-line-breaking)
+            while line
+            do (let ((string (subseq line 0 (max 0 (1- (or (position #\# line) 1))))))
+                 (unless (string= string "")
+                   (let* ((expected (process-line-break-line string))
+                          (annotated (sb-unicode::line-break-annotate
+                                      (string-from-line-break-line string)))
+                          (actual (substitute :can :must annotated)))
+                     (if (gethash string line-break-exceptions)
+                         (assert (not (equal expected actual)))
+                         (assert (equal expected actual))))))))))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL


_______________________________________________
Sbcl-commits mailing list
Sbcl-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic