def test_getlower(): assert rsre_char.getlower(ord('A'), 0) == ord('a') assert rsre_char.getlower(ord('2'), 0) == ord('2') assert rsre_char.getlower(10, 0) == 10 assert rsre_char.getlower(UPPER_PI, 0) == UPPER_PI # assert rsre_char.getlower(ord('A'), SRE_FLAG_UNICODE) == ord('a') assert rsre_char.getlower(ord('2'), SRE_FLAG_UNICODE) == ord('2') assert rsre_char.getlower(10, SRE_FLAG_UNICODE) == 10 assert rsre_char.getlower(UPPER_PI, SRE_FLAG_UNICODE) == LOWER_PI # # xxx the following cases are like CPython's. They are obscure. # (iko) that's a nice way to say "broken" assert rsre_char.getlower(UPPER_PI, SRE_FLAG_LOCALE) == UPPER_PI assert rsre_char.getlower(UPPER_PI, SRE_FLAG_LOCALE | SRE_FLAG_UNICODE) \ == UPPER_PI
def lower(self, char_ord): return getlower(char_ord, self.flags)
def w_getlower(space, char_ord, flags): return space.wrap(getlower(char_ord, flags))
def lowstr(self, index): c = self.str(index) return rsre_char.getlower(c, self.flags)
def test_getlower(): assert rsre_char.getlower(ord("A"), 0) == ord("a")
def lower(self, char_ord): return getlower(char_ord, 0)