2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit a3a5b54a authored by di68kap's avatar di68kap
Browse files

- minor corrections

parent adc76f68
...@@ -16,7 +16,7 @@ implied. See the License for the specific language governing ...@@ -16,7 +16,7 @@ implied. See the License for the specific language governing
permissions and limitations under the License. permissions and limitations under the License.
""" """
import copy import copy
import inspect
import regex as re import regex as re
from DHParser import Node, error_messages from DHParser import Node, error_messages
...@@ -140,7 +140,7 @@ def runner(tests, namespace): ...@@ -140,7 +140,7 @@ def runner(tests, namespace):
pass pass
if __name__ == "__main__": if __name__ == "__main__":
from run import runner from DHParser.testing import runner
runner("", globals()) runner("", globals())
""" """
def instantiate(cls_name): def instantiate(cls_name):
......
#!/usr/bin/python3 #!/usr/bin/python3
"""test_MLW_grammar.py - test code for the MLW grammar """test_MLW_grammar.py - unit tests for the MLW grammar
Author: Eckhart Arnold <arnold@badw.de> Author: Eckhart Arnold <arnold@badw.de>
...@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
""" """
import DHParser.testing from DHParser import testing
from DHParser import parsers from DHParser import parsers
# from DHParser.dsl import load_compiler_suite # from DHParser.dsl import load_compiler_suite
from MLW_compiler import get_MLW_grammar, get_MLW_transformer from MLW_compiler import get_MLW_grammar, get_MLW_transformer
...@@ -33,7 +33,7 @@ MLW_TEST_CASES_LEMMA_POSITION = { ...@@ -33,7 +33,7 @@ MLW_TEST_CASES_LEMMA_POSITION = {
3: "fasc|itergula" 3: "fasc|itergula"
}, },
"fail": { "fail": {
9: "duo vocabula" 99: "duo vocabula"
} }
}, },
...@@ -57,19 +57,20 @@ MLW_TEST_CASES_LEMMA_POSITION = { ...@@ -57,19 +57,20 @@ MLW_TEST_CASES_LEMMA_POSITION = {
3: " fasc-itergula fac-iet-ergula ZUSATZ sim.", 3: " fasc-itergula fac-iet-ergula ZUSATZ sim.",
}, },
"fail": { "fail": {
9: "* fascitergula" 99: "* fascitergula"
} }
} }
} }
class TestMLWGrammar: class TestMLWGrammar:
def test_lemma_position(self): def test_lemma_position(self):
errata = DHParser.testing.test_grammar(MLW_TEST_CASES_LEMMA_POSITION, errata = testing.test_grammar(MLW_TEST_CASES_LEMMA_POSITION,
get_MLW_grammar, get_MLW_grammar,
get_MLW_transformer) get_MLW_transformer)
assert not errata, str(errata) assert not errata, str(errata)
if __name__ == "__main__":
testing.runner("", globals())
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