# HG changeset patch # User Aidan Kehoe # Date 1264879423 0 # Node ID 0eccfd4850d60d5cf6405ee8158dd72c26820af5 # Parent aa8197436fdb8948d63fbea8cd335fbe1fb84679 Add tests for the regexp-ranges-treat-control-1-chars badly bug. 2010-01-30 Aidan Kehoe * 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 + + * 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 * 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)