MCPcopy Create free account
hub / github.com/nodejs/node / testRegex

Method testRegex

deps/v8/tools/release/test_scripts.py:369–388  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

367 self.assertEquals("0", step["patch"])
368
369 def testRegex(self):
370 self.assertEqual("(issue 321)",
371 re.sub(r"BUG=v8:(.*)$", r"(issue \1)", "BUG=v8:321"))
372 self.assertEqual("(Chromium issue 321)",
373 re.sub(r"BUG=(.*)$", r"(Chromium issue \1)", "BUG=321"))
374
375 cl = " too little\n\ttab\ttab\n too much\n trailing "
376 cl = MSub(r"\t", r" ", cl)
377 cl = MSub(r"^ {1,7}([^ ])", r" \1", cl)
378 cl = MSub(r"^ {9,80}([^ ])", r" \1", cl)
379 cl = MSub(r" +$", r"", cl)
380 self.assertEqual(" too little\n"
381 " tab tab\n"
382 " too much\n"
383 " trailing", cl)
384
385 self.assertEqual("//\n#define V8_BUILD_NUMBER 3\n",
386 MSub(r"(?<=#define V8_BUILD_NUMBER)(?P<space>\s+)\d*$",
387 r"\g<space>3",
388 "//\n#define V8_BUILD_NUMBER 321\n"))
389
390 TAGS = """
3914425.0

Callers

nothing calls this directly

Calls 1

MSubFunction · 0.85

Tested by

no test coverage detected