Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Martin Claus
py-namelist
Commits
39097c37
Commit
39097c37
authored
Oct 02, 2018
by
Martin Claus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for _tokenize
parent
fbb7d433
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
tests/test_parsing.py
tests/test_parsing.py
+14
-0
No files found.
tests/test_parsing.py
View file @
39097c37
...
...
@@ -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,
\n
val2=35/"
,
[
'&n'
,
'val1'
,
'='
,
'34'
,
'val2'
,
'='
,
'35/'
]),
(
"&n val1=34,
\n
val2=35 /"
,
[
'&n'
,
'val1'
,
'='
,
'34'
,
'val2'
,
'='
,
'35'
,
'/'
]),
]
)
def
test_tokenize
(
string
,
res
):
nml
=
namelist
.
namelist
.
_tokenize
(
string
)
assert
nml
==
res
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment