MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / parse_test

Function parse_test

run_tests.py:10–25  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

8executable = "${TESTPROG}"
9
10def parse_test(raw):
11 raw = re.compile('#.*$', re.M).sub('', raw).strip()
12 if raw.startswith('"""'):
13 raw = raw[3:]
14
15 for fixture in raw.split('r"""'):
16 name = ''
17 doc, _, body = fixture.partition('"""')
18 cases = []
19 for case in body.split('$')[1:]:
20 argv, _, expect = case.strip().partition('\n')
21 expect = json.loads(expect)
22 prog, _, argv = argv.strip().partition(' ')
23 cases.append((prog, argv, expect))
24
25 yield name, doc, cases
26
27failures = 0
28passes = 0

Callers 1

run_tests.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected