diff tests/automated/query-coding-tests.el @ 5136:0f66906b6e37

Undo Assert-equal, Assert=, etc.; make `Assert' handle this automatically -------------------- ChangeLog entries follow: -------------------- lisp/ChangeLog addition: 2010-03-12 Ben Wing <ben@xemacs.org> * test-harness.el (test-harness-from-buffer): Undo change of e.g. (Assert (equalp ...)) to (Assert-equalp ...). Get rid of `Assert-equalp' and friends, `Assert-test', and `Assert-test-not'. Instead, make `Assert' smart enough to do the equivalent functionality when an expression like (Assert (equalp ...)) is seen. tests/ChangeLog addition: 2010-03-12 Ben Wing <ben@xemacs.org> * automated/base64-tests.el (bt-base64-encode-string): * automated/base64-tests.el (bt-base64-decode-string): * automated/base64-tests.el (for): * automated/byte-compiler-tests.el: * automated/byte-compiler-tests.el (before-and-after-compile-equal): * automated/case-tests.el (downcase-string): * automated/case-tests.el (uni-mappings): * automated/ccl-tests.el (ccl-test-normal-expr): * automated/ccl-tests.el (ccl-test-map-instructions): * automated/ccl-tests.el (ccl-test-suites): * automated/database-tests.el (delete-database-files): * automated/extent-tests.el (let): * automated/extent-tests.el (insert): * automated/extent-tests.el (props): * automated/file-tests.el: * automated/file-tests.el (for): * automated/hash-table-tests.el (test): * automated/hash-table-tests.el (for): * automated/hash-table-tests.el (ht): * automated/hash-table-tests.el (iterations): * automated/hash-table-tests.el (h1): * automated/hash-table-tests.el (equal): * automated/hash-table-tests.el (=): * automated/lisp-tests.el: * automated/lisp-tests.el (eq): * automated/lisp-tests.el (test-setq): * automated/lisp-tests.el (my-vector): * automated/lisp-tests.el (x): * automated/lisp-tests.el (equal): * automated/lisp-tests.el (y): * automated/lisp-tests.el (featurep): * automated/lisp-tests.el (=): * automated/lisp-tests.el (six): * automated/lisp-tests.el (three): * automated/lisp-tests.el (one): * automated/lisp-tests.el (two): * automated/lisp-tests.el (five): * automated/lisp-tests.el (test1): * automated/lisp-tests.el (division-test): * automated/lisp-tests.el (for): * automated/lisp-tests.el (check-function-argcounts): * automated/lisp-tests.el (z): * automated/lisp-tests.el (eql): * automated/lisp-tests.el (test-harness-risk-infloops): * automated/lisp-tests.el (erase-buffer): * automated/lisp-tests.el (sym): * automated/lisp-tests.el (new-char): * automated/lisp-tests.el (new-load-file-name): * automated/lisp-tests.el (cl-floor): * automated/lisp-tests.el (foo): * automated/md5-tests.el (lambda): * automated/md5-tests.el (large-string): * automated/md5-tests.el (mapcar): * automated/md5-tests.el (insert): * automated/mule-tests.el: * automated/mule-tests.el (test-chars): * automated/mule-tests.el (existing-file-name): * automated/mule-tests.el (featurep): * automated/query-coding-tests.el (featurep): * automated/regexp-tests.el: * automated/regexp-tests.el (insert): * automated/regexp-tests.el (Assert): * automated/regexp-tests.el (=): * automated/regexp-tests.el (featurep): * automated/regexp-tests.el (text): * automated/regexp-tests.el (text1): * automated/regexp-tests.el ("aáa"): * automated/regexp-tests.el (eql): * automated/search-tests.el (insert): * automated/search-tests.el (featurep): * automated/search-tests.el (let): * automated/search-tests.el (boundp): * automated/symbol-tests.el: * automated/symbol-tests.el (name): * automated/symbol-tests.el (check-weak-list-unique): * automated/symbol-tests.el (string): * automated/symbol-tests.el (list): * automated/symbol-tests.el (foo): * automated/symbol-tests.el (eq): * automated/symbol-tests.el (fresh-keyword-name): * automated/symbol-tests.el (print-gensym): * automated/symbol-tests.el (mysym): * automated/syntax-tests.el (test-forward-word): * automated/syntax-tests.el (test-backward-word): * automated/syntax-tests.el (test-syntax-table): * automated/syntax-tests.el (with-syntax-table): * automated/syntax-tests.el (Skip-Test-Unless): * automated/syntax-tests.el (with): * automated/tag-tests.el (testfile): * automated/weak-tests.el (w): * automated/weak-tests.el (p): * automated/weak-tests.el (a): Undo change of e.g. (Assert (equalp ...)) to (Assert-equalp ...). Get rid of `Assert-equalp' and friends, `Assert-test', and `Assert-test-not'. Instead, make `Assert' smart enough to do the equivalent functionality when an expression like (Assert (equalp ...)) is seen.
author Ben Wing <ben@xemacs.org>
date Fri, 12 Mar 2010 18:27:51 -0600
parents 189fb67ca31a
children 3889ef128488 308d34e9f07d
line wrap: on
line diff
--- a/tests/automated/query-coding-tests.el	Sun Mar 07 06:43:19 2010 -0600
+++ b/tests/automated/query-coding-tests.el	Fri Mar 12 18:27:51 2010 -0600
@@ -70,7 +70,7 @@
                 :test #'eq))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region (point-min) (point-max) coding-system)
-          (Assert-eq t query-coding-succeeded
+          (Assert (eq t query-coding-succeeded)
                   (format "checking query-coding-region ASCII-transparency, %s"
                           coding-system))
           (Assert (null query-coding-table)
@@ -78,7 +78,7 @@
                           coding-system)))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-string ascii-chars-string coding-system)
-          (Assert-eq t query-coding-succeeded
+          (Assert (eq t query-coding-succeeded)
                   (format "checking query-coding-string ASCII-transparency, %s"
                           coding-system))
           (Assert (null query-coding-table)
@@ -89,19 +89,20 @@
       (insert latin-1-chars-string)
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'iso-8859-1-unix)
-        (Assert-eq t query-coding-succeeded
+        (Assert (eq t query-coding-succeeded)
                 "checking query-coding-region iso-8859-1-transparency")
         (Assert (null query-coding-table)
                 "checking query-coding-region iso-8859-1-transparency"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-string (buffer-string) 'iso-8859-1-unix)
-        (Assert-eq t query-coding-succeeded
+        (Assert (eq t query-coding-succeeded)
                 "checking query-coding-string iso-8859-1-transparency")
         (Assert (null query-coding-table)
                 "checking query-coding-string iso-8859-1-transparency"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-string (buffer-string) 'iso-latin-1-with-esc-unix)
-        (Assert-eq t query-coding-succeeded
+        (Assert
+         (eq t query-coding-succeeded)
          "checking query-coding-region iso-latin-1-with-esc-transparency")
         (Assert
          (null query-coding-table)
@@ -113,9 +114,10 @@
         (Assert
          (null query-coding-succeeded)
          "checking that query-coding-region fails, U+20AC, iso-8859-1")
-        (Assert-equal query-coding-table
+        (Assert
+         (equal query-coding-table
                 #s(range-table type start-closed-end-open data
-                               ((257 258) unencodable))
+                               ((257 258) unencodable)))
          "checking query-coding-region fails correctly, U+20AC, iso-8859-1"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max)
@@ -159,17 +161,19 @@
         (Assert
          (null query-coding-succeeded)
          "check query-coding-region fails, windows-1252, invalid-sequences")
-        (Assert-equal query-coding-table
+        (Assert
+         (equal query-coding-table
                 #s(range-table type start-closed-end-open
                                data ((130 131) invalid-sequence
                                      (142 143) invalid-sequence
                                      (144 146) invalid-sequence
-                                     (158 159) invalid-sequence))
+                                     (158 159) invalid-sequence)))
          "check query-coding-region fails, windows-1252, invalid-sequences"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'windows-1252-unix
 			       (current-buffer) t)
-        (Assert-eq t query-coding-succeeded
+        (Assert
+         (eq t query-coding-succeeded)
          "checking that query-coding-region succeeds, U+20AC, windows-1252")
         (Assert
          (null query-coding-table)
@@ -181,22 +185,24 @@
         (Assert
          (null query-coding-succeeded)
          "checking that query-coding-region fails, U+0080, windows-1252")
-        (Assert-equal query-coding-table
+        (Assert
+         (equal query-coding-table
                 #s(range-table type start-closed-end-open data
-                               ((257 258) unencodable))
+                               ((257 258) unencodable)))
          "checking that query-coding-region fails, U+0080, windows-1252"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'windows-1252-unix)
         (Assert
          (null query-coding-succeeded)
          "check query-coding-region fails, U+0080, invalid-sequence, cp1252")
-        (Assert-equal query-coding-table
+        (Assert
+         (equal query-coding-table
                 #s(range-table type start-closed-end-open
                                data ((130 131) invalid-sequence
                                      (142 143) invalid-sequence
                                      (144 146) invalid-sequence
                                      (158 159) invalid-sequence
-                                     (257 258) unencodable))
+                                     (257 258) unencodable)))
          "check query-coding-region fails, U+0080, invalid-sequence, cp1252"))
       ;; Try a similar approach with koi8-o, the koi8 variant with
       ;; support for Old Church Slavonic.
@@ -213,7 +219,7 @@
          "checking that query-coding-region succeeds, koi8-o-unix"))
       (multiple-value-bind (query-coding-succeeded query-coding-table)
           (query-coding-region (point-min) (point-max) 'escape-quoted)
-        (Assert-eq t query-coding-succeeded
+        (Assert (eq t query-coding-succeeded)
          "checking that query-coding-region succeeds, escape-quoted")
         (Assert (null query-coding-table)
          "checking that query-coding-region succeeds, escape-quoted"))
@@ -277,15 +283,15 @@
             (query-coding-region (point-min) (point-max) coding-system)
           (Assert (null query-coding-succeeded)
                   "checking unicode coding systems fail with unmapped chars")
-          (Assert-equal query-coding-table
+          (Assert (equal query-coding-table
                          #s(range-table type start-closed-end-open data
                                         ((173 174) unencodable
                                          (209 210) unencodable
-                                         (254 255) unencodable))
+                                         (254 255) unencodable)))
                   "checking unicode coding systems fail with unmapped chars"))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region (point-min) 173 coding-system)
-          (Assert-eq t query-coding-succeeded
+          (Assert (eq t query-coding-succeeded)
                   "checking unicode coding systems succeed sans unmapped chars")
           (Assert
            (null query-coding-table)
@@ -300,7 +306,7 @@
            "checking unicode coding systems succeed sans unmapped chars again"))
         (multiple-value-bind (query-coding-succeeded query-coding-table)
             (query-coding-region 210 254 coding-system)
-          (Assert-eq t query-coding-succeeded)
+          (Assert (eq t query-coding-succeeded))
           (Assert (null query-coding-table)))
         ;; Check that it errors correctly. 
         (setq text-conversion-error-signalled nil)
@@ -336,11 +342,11 @@
                   (format 
                    "checking %s fails with unmapped chars and invalid seqs"
                    coding-system))
-          (Assert-equal query-coding-table
+          (Assert (equal query-coding-table
                          #s(range-table type start-closed-end-open
                                         data ((1 5) unencodable
                                               (5 9) invalid-sequence
-                                              (9 13) unencodable))
+                                              (9 13) unencodable)))
                   (format 
                    "checking %s fails with unmapped chars and invalid seqs"
                    coding-system)))
@@ -390,23 +396,23 @@
        "check #'unencodable-char-position has some borked GNU semantics")
       (dotimes (i 6) (insert (decode-char 'ucs #x20ac)))
       ;; Check if it stops at one:
-      (Assert-equal '(257) (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 1)
+      (Assert (equal '(257) (unencodable-char-position (point-min) (point-max)
+                                                       'iso-8859-1 1))
               "check #'unencodable-char-position stops at 1 when asked to")
       ;; Check if it stops at four:
-      (Assert-equal '(260 259 258 257)
+      (Assert (equal '(260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 4)
+                                                       'iso-8859-1 4))
               "check #'unencodable-char-position stops at 4 when asked to")
       ;; Check whether it stops at seven: 
-      (Assert-equal '(263 262 261 260 259 258 257)
+      (Assert (equal '(263 262 261 260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 7)
+                                                       'iso-8859-1 7))
               "check #'unencodable-char-position stops at 7 when asked to")
       ;; Check that it still stops at seven:
-      (Assert-equal '(263 262 261 260 259 258 257)
+      (Assert (equal '(263 262 261 260 259 258 257)
                      (unencodable-char-position (point-min) (point-max)
-                                                       'iso-8859-1 2000)
+                                                       'iso-8859-1 2000))
               "check #'unencodable-char-position stops at 7 if 2000 asked for")
       ;; Now, #'check-coding-systems-region. 
       ;; UTF-8 should certainly be able to encode these characters: