Commit 39097c37 authored by Martin Claus's avatar Martin Claus

Added test for _tokenize

parent fbb7d433
......@@ -43,3 +43,17 @@ def test_match_multiple_name_val(string):
assert nml.name == "nml3"
assert nml["val1"] == 34
assert nml["val2"] == 35
@pytest.mark.parametrize(
"string,res",
[("&nml3 &end", ["&nml3", "&end"]),
("&n val1=34,\nval2=35/",
['&n', 'val1', '=', '34', 'val2', '=', '35/']),
("&n val1=34,\nval2=35 /",
['&n', 'val1', '=', '34', 'val2', '=', '35', '/']),
]
)
def test_tokenize(string, res):
nml = namelist.namelist._tokenize(string)
assert nml == res
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment