MCPcopy Create free account
hub / github.com/davidblewett/rure-python / test_flags

Method test_flags

rure/tests/test_rure.py:110–121  ·  view source on GitHub ↗

Test whether we can set the flags correctly. In this case, we disable all flags, which includes disabling Unicode mode. When we disable Unicode mode, we can match arbitrary possibly invalid UTF-8 bytes, such as \xFF. (When Unicode mode is enabled, \xFF won't match .)

(self)

Source from the content-addressed store, hash-verified

108 )
109
110 def test_flags(self):
111 """Test whether we can set the flags correctly.
112
113 In this case, we disable all flags, which includes disabling
114 Unicode mode. When we disable Unicode mode, we can match
115 arbitrary possibly invalid UTF-8 bytes, such as \xFF.
116 (When Unicode mode is enabled, \xFF won't match .)
117 """
118 pattern = b"."
119 haystack = b"\xFF"
120 re = Rure(pattern, flags=CASEI)
121 self.assertTrue(re.is_match(haystack))
122
123 def test_compile_error(self):
124 try:

Callers

nothing calls this directly

Calls 2

is_matchMethod · 0.95
RureClass · 0.90

Tested by

no test coverage detected