Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
badw-it
DHParser
Commits
a3a5b54a
Commit
a3a5b54a
authored
May 11, 2017
by
di68kap
Browse files
- minor corrections
parent
adc76f68
Changes
2
Hide whitespace changes
Inline
Side-by-side
DHParser/testing.py
View file @
a3a5b54a
...
...
@@ -16,7 +16,7 @@ implied. See the License for the specific language governing
permissions and limitations under the License.
"""
import
copy
import
inspect
import
regex
as
re
from
DHParser
import
Node
,
error_messages
...
...
@@ -140,7 +140,7 @@ def runner(tests, namespace):
pass
if __name__ == "__main__":
from
run
import runner
from
DHParser.testing
import runner
runner("", globals())
"""
def
instantiate
(
cls_name
):
...
...
examples/MLW/test_MLW_grammar.py
View file @
a3a5b54a
#!/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>
...
...
@@ -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
limitations under the License.
"""
import
DHParser
.
testing
from
DHParser
import
testing
from
DHParser
import
parsers
# from DHParser.dsl import load_compiler_suite
from
MLW_compiler
import
get_MLW_grammar
,
get_MLW_transformer
...
...
@@ -33,7 +33,7 @@ MLW_TEST_CASES_LEMMA_POSITION = {
3
:
"fasc|itergula"
},
"fail"
:
{
9
:
"duo vocabula"
9
9
:
"duo vocabula"
}
},
...
...
@@ -57,19 +57,20 @@ MLW_TEST_CASES_LEMMA_POSITION = {
3
:
" fasc-itergula fac-iet-ergula ZUSATZ sim."
,
},
"fail"
:
{
9
:
"* fascitergula"
9
9
:
"* fascitergula"
}
}
}
class
TestMLWGrammar
:
def
test_lemma_position
(
self
):
errata
=
DHParser
.
testing
.
test_grammar
(
MLW_TEST_CASES_LEMMA_POSITION
,
get_MLW_grammar
,
get_MLW_transformer
)
errata
=
testing
.
test_grammar
(
MLW_TEST_CASES_LEMMA_POSITION
,
get_MLW_grammar
,
get_MLW_transformer
)
assert
not
errata
,
str
(
errata
)
if
__name__
==
"__main__"
:
testing
.
runner
(
""
,
globals
())
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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