changeset 1195:dff007bd492b

[xemacs-hg @ 2003-01-09 12:49:36 by stephent] unit test cases <873co2wkua.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 09 Jan 2003 12:49:43 +0000
parents b28cb5c230a2
children 6c18935dbbf8
files tests/ChangeLog tests/automated/mule-tests.el tests/automated/regexp-tests.el
diffstat 3 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/ChangeLog	Wed Jan 08 22:52:54 2003 +0000
+++ b/tests/ChangeLog	Thu Jan 09 12:49:43 2003 +0000
@@ -1,3 +1,12 @@
+2003-01-09  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/mule-tests.el: Test cases for charset-in-* functions.
+
+2003-01-06  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* automated/regexp-tests.el (stale match data): Stale match data
+	persists after failed match.  Thanks to <bjacob@ca.metsci.com>.
+
 2003-01-04  Steve Youngs  <youngs@xemacs.org>
 
 	* XEmacs 21.5.10 "burdock" is released.
--- a/tests/automated/mule-tests.el	Wed Jan 08 22:52:54 2003 +0000
+++ b/tests/automated/mule-tests.el	Thu Jan 09 12:49:43 2003 +0000
@@ -327,4 +327,27 @@
 	(Assert (eq scaron (unicode-to-char code '(latin-iso8859-2))))))
   
     (Check-Error wrong-type-argument (set-unicode-conversion scaron -10000)))
+
+  ;;---------------------------------------------------------------
+  ;; Test charset-in-* functions
+  ;;---------------------------------------------------------------
+  (with-temp-buffer
+    (insert-file-contents (locate-data-file "HELLO"))
+    ;; #### rewrite robustly, both assume that the tested implementation
+    ;; uses the same algorithm as was used by the version current at time
+    ;; this test was written
+    (Assert (eq (charsets-in-region (point-min) (point-max))
+		'(korean-ksc5601 chinese-big5-1 chinese-gb2312
+		  japanese-jisx0212 katakana-jisx0201 japanese-jisx0208
+		  vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5
+		  hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1
+		  latin-iso8859-2 arabic-2-column arabic-1-column
+		  ethiopic ascii)))
+    (Assert (eq (charsets-in-string (buffer-substring (point-min) (point-max)))
+		'(korean-ksc5601 chinese-big5-1 chinese-gb2312
+		  japanese-jisx0212 katakana-jisx0201 japanese-jisx0208
+		  vietnamese-viscii-lower thai-xtis cyrillic-iso8859-5
+		  hebrew-iso8859-8 greek-iso8859-7 latin-iso8859-1
+		  latin-iso8859-2 arabic-2-column arabic-1-column
+		  ethiopic ascii))))
   )
--- a/tests/automated/regexp-tests.el	Wed Jan 08 22:52:54 2003 +0000
+++ b/tests/automated/regexp-tests.el	Thu Jan 09 12:49:43 2003 +0000
@@ -279,3 +279,18 @@
       (Assert (not (string-match "@[A]" (string ?@ ch1))))
       (Assert (eq (string-match "@[^A]" (string ?@ ch1)) 0))
       (Assert (not (string-match "@?A" (string ?@ ch1))))))
+
+;; More stale match data tests.
+;; Thanks to <bjacob@ca.metsci.com>.
+(Assert (not (progn (string-match "a" "a")
+		    (string-match "b" "a")
+		    (match-string 0 "a"))))
+(Assert (not (progn (string-match "a" "a")
+		    (string-match "b" "a")
+		    (match-string 1 "a"))))
+(Assert (not (progn (string-match "\\(a\\)" "a")
+		    (string-match "\\(b\\)" "a")
+		    (match-string 0 "a"))))
+(Assert (not (progn (string-match "\\(a\\)" "a")
+		    (string-match "\\(b\\)" "a")
+		    (match-string 1 "a"))))