MCPcopy Create free account
hub / github.com/coooodeer/parse-rust / y

Function y

tests/test_parse.py:235–243  ·  view source on GitHub ↗
(fmt, s, e, str_equals=False)

Source from the content-addressed store, hash-verified

233def test_numbers():
234 # pull a numbers out of a string
235 def y(fmt, s, e, str_equals=False):
236 p = parse.compile(fmt)
237 r = p.parse(s)
238 assert r is not None, "{!r} does not match {!r} ({!r})".format(s, fmt, p._expression)
239 r = r.fixed[0]
240 if str_equals:
241 assert str(r) == str(e)
242 else:
243 assert r == e
244
245 def n(fmt, s, e):
246 assert parse.parse(fmt, s) is None

Callers 2

test_numbersFunction · 0.85
test_datetimesFunction · 0.85

Calls 3

compileMethod · 0.80
formatMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected