Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
badw-it
DHParser
Commits
e7dda4f5
Commit
e7dda4f5
authored
Jun 22, 2018
by
Eckhart Arnold
Browse files
dhparser fixed
parent
cd69c3fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
dhparser.py
View file @
e7dda4f5
...
...
@@ -207,7 +207,7 @@ def create_project(path: str):
create_file
(
'README.md'
,
README_TEMPLATE
.
format
(
name
=
name
))
create_file
(
'tst_%s_grammar.py'
%
name
,
GRAMMAR_TEST_TEMPLATE
.
format
(
name
=
name
,
dhparserdir
=
dhparserdir
))
create_file
(
'example.
xm
l'
,
'Life is but a walking shadow
\n
'
)
create_file
(
'example.
ds
l'
,
'Life is but a walking shadow
\n
'
)
os
.
chmod
(
'tst_%s_grammar.py'
%
name
,
0o755
)
# The following is left to the user as an exercise
# print('Creating file "%s".' % (name + 'Compiler.py'))
...
...
test/test_dhparser.py
View file @
e7dda4f5
...
...
@@ -45,10 +45,11 @@ class TestDHParserCommandLineTool:
def
test_dhparser
(
self
):
os
.
system
(
'python ../dhparser.py testdata/neu >/dev/null'
)
os
.
system
(
'python testdata/neu/tst_neu_grammar.py >/dev/null'
)
os
.
system
(
'python testdata/neu/neuCompiler.py testdata/neu/example.xml >testdata/neu/example.xml'
)
os
.
system
(
'python testdata/neu/neuCompiler.py testdata/neu/example.dsl '
'>testdata/neu/example.xml'
)
with
open
(
'testdata/neu/example.xml'
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
xml
=
f
.
read
()
assert
xml
.
find
(
'<document>'
)
>=
0
assert
xml
.
find
(
'<document>'
)
>=
0
,
xml
if
__name__
==
"__main__"
:
from
DHParser.testing
import
runner
...
...
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