File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ import modflow_devtools .models as models
14from modflow_devtools .codec import make_parser
25
6+ MODELS = [name for name in models .get_models ().keys () if name .startswith ("mf6/" )]
7+
38
4- def test_parser ():
9+ @pytest .mark .parametrize ("model_name" , MODELS )
10+ def test_parser (model_name , function_tmpdir ):
11+ workspace = models .copy_to (function_tmpdir , model_name )
12+ nam_path = next (iter (workspace .glob ("*.nam" )))
13+ text = nam_path .open ().read ()
514 parser = make_parser ()
6- text = """
7- BEGIN OPTIONS
8- AN OPTION
9- ANOTHER OPTION
10- END OPTIONS
11- BEGIN PACKAGEDATA
12- END PACKAGEDATA
13- """
1415 tree = parser .parse (text )
1516 print (tree .pretty ())
Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ class Dfn(TypedDict):
164164 name : str
165165 advanced : bool
166166 multi : bool
167- ref : Optional [ Ref ]
168- sln : Optional [ Sln ]
169- fkeys : Optional [ Dfns ]
167+ ref : Ref | None
168+ sln : Sln | None
169+ fkeys : Dfns | None
170170
171171 @staticmethod
172172 def _load_v1_flat (f , common : dict | None = None ) -> tuple [Mapping , list [str ]]:
Original file line number Diff line number Diff line change 11start : [WS ] block + [WS ]
2-
32block : " begin" i CNAME _ NL _ content " end" i CNAME _ NL
43_ content: line * [WS ]
54line : [WS ] value * _ NL
65value : WORD | NUMBER
76
8-
97%import common .NEWLINE -> _ NL
108%import common .WS
119%import common .WS_INLINE
1210%import common .CNAME
1311%import common .WORD
1412%import common .NUMBER
15- %ignore WS_INLINE
13+ %import common .SH_COMMENT
14+ %ignore WS_INLINE
15+ %ignore SH_COMMENT
You can’t perform that action at this time.
0 commit comments