carbon2-commit: Add tests for the regexp-ranges-treat-control-1-chars badly bug.

Aidan Kehoe kehoea at parhasard.net
Sun Feb 7 12:39:49 EST 2010


changeset:   4948:0eccfd4850d6
user:        Aidan Kehoe <kehoea at parhasard.net>
date:        Sat Jan 30 19:23:43 2010 +0000
files:       tests/ChangeLog tests/automated/regexp-tests.el
description:
Add tests for the regexp-ranges-treat-control-1-chars badly bug.

2010-01-30  Aidan Kehoe  <kehoea at parhasard.net>

	* automated/regexp-tests.el:
	Make sure that control-1 characters are no longer treated as
	second-class citizens in regexp ranges, as in
	http://mid.gmane.org/18829.34118.709782.704574@parhasard.net .


diff -r aa8197436fdb -r 0eccfd4850d6 tests/ChangeLog
--- a/tests/ChangeLog	Sat Jan 30 15:47:37 2010 +0000
+++ b/tests/ChangeLog	Sat Jan 30 19:23:43 2010 +0000
@@ -1,3 +1,10 @@
+2010-01-30  Aidan Kehoe  <kehoea at parhasard.net>
+
+	* automated/regexp-tests.el:
+	Make sure that control-1 characters are no longer treated as
+	second-class citizens in regexp ranges, as in
+	http://mid.gmane.org/18829.34118.709782.704574@parhasard.net .
+
 2010-01-29  Ben Wing  <ben at xemacs.org>
 
 	* automated/search-tests.el:
diff -r aa8197436fdb -r 0eccfd4850d6 tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el	Sat Jan 30 15:47:37 2010 +0000
+++ b/tests/automated/regexp-tests.el	Sat Jan 30 19:23:43 2010 +0000
@@ -582,3 +582,19 @@
   (replace-match "\\U" t)
   (Assert (and (bobp) (eobp))))
 
+;; Control-1 characters were second-class citizens in regexp ranges
+;; for a while there.  Addressed in Ben's Mercurial changeset
+;; 2e15c29cc2b3; attempt to ensure this doesn't happen again.
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "a") 0)
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "é") nil)
+;; Gave nil in 21.5 for a couple of years.
+(Assert-eql (string-match "[\x00-\x7f\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x00-\x7f]\\|[\x80-\x9f]" "\x80") 0)
+;; Gave nil
+(Assert-eql (string-match "[\x7f\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7f\x80-\x9e]" "\x80") 0)
+;; Used to succeed even with the bug.
+(Assert-eql (string-match "[\x7f\x80\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7e\x80-\x9f]" "\x80") 0)
+(Assert-eql (string-match "[\x7f\x81-\x9f]" "\x81") 0)



More information about the XEmacs-Patches mailing list