kopia lustrzana https://github.com/micropython/micropython
re: Fixup linting of test files.
rodzic
3e5a718f84
commit
8c28d63538
|
@ -5,21 +5,21 @@ except ImportError:
|
|||
print("SKIP")
|
||||
raise SystemExit
|
||||
|
||||
ms = re.finditer(r'f[a-z]*', 'which foot or hand fell fastest')
|
||||
ms = re.finditer(r"f[a-z]*", "which foot or hand fell fastest")
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
||||
p = re.compile(r'f[a-z]*')
|
||||
ms = p.finditer('which foot or hand fell fastest')
|
||||
p = re.compile(r"f[a-z]*")
|
||||
ms = p.finditer("which foot or hand fell fastest")
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
||||
ms = p.finditer('which foot or hand fell fastest', 10)
|
||||
ms = p.finditer("which foot or hand fell fastest", 10)
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
||||
ms = p.finditer('which foot or hand fell fastest', 10, 21)
|
||||
ms = p.finditer("which foot or hand fell fastest", 10, 21)
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
||||
ms = re.finditer(r'\s+', 'which foot or hand fell fastest')
|
||||
ms = re.finditer(r"\s+", "which foot or hand fell fastest")
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
||||
ms = re.finditer(r'zz', 'which foot or hand fell fastest')
|
||||
ms = re.finditer(r"zz", "which foot or hand fell fastest")
|
||||
print(list(x.group(0) for x in ms))
|
||||
|
|
|
@ -18,6 +18,7 @@ def print_groups(match):
|
|||
except IndexError:
|
||||
pass
|
||||
|
||||
|
||||
p = re.compile(r"o")
|
||||
m = p.match("dog")
|
||||
print_groups(m)
|
||||
|
@ -45,15 +46,14 @@ m = p.match("dog", 1, 1)
|
|||
print_groups(m)
|
||||
|
||||
# Search also works
|
||||
print('--search')
|
||||
print("--search")
|
||||
|
||||
p = re.compile(r"o")
|
||||
m = p.search('dog')
|
||||
m = p.search("dog")
|
||||
print_groups(m)
|
||||
|
||||
m = p.search('dog', 1)
|
||||
m = p.search("dog", 1)
|
||||
print_groups(m)
|
||||
|
||||
m = p.search('dog', 2)
|
||||
m = p.search("dog", 2)
|
||||
print_groups(m)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue