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

Method test_flags

rure/tests/test_rureset.py:30–41  ·  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

28 self.assertEqual(len(res), 3)
29
30 def test_flags(self):
31 """Test whether we can set the flags correctly.
32
33 In this case, we disable all flags, which includes disabling
34 Unicode mode. When we disable Unicode mode, we can match
35 arbitrary possibly invalid UTF-8 bytes, such as \xFF.
36 (When Unicode mode is enabled, \xFF won't match .)
37 """
38 pattern = b"."
39 haystack = b"\xFF"
40 res = RureSet(pattern, flags=CASEI)
41 self.assertTrue(res.is_match(haystack))
42
43 def test_compile_error(self):
44 try:

Callers

nothing calls this directly

Calls 2

is_matchMethod · 0.95
RureSetClass · 0.90

Tested by

no test coverage detected