Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
trs
Commits
bd3112ba
Commit
bd3112ba
authored
Nov 24, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added external graph_drawing submodule.
parent
ac56e741
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
6 deletions
+17
-6
.gitmodules
.gitmodules
+3
-0
external/graph_drawing
external/graph_drawing
+1
-0
src/calc.py
src/calc.py
+3
-0
tests/rules.mk
tests/rules.mk
+1
-1
tests/test_calc.py
tests/test_calc.py
+4
-4
tests/test_variables.py
tests/test_variables.py
+5
-1
No files found.
.gitmodules
View file @
bd3112ba
[submodule "external/pybison"]
[submodule "external/pybison"]
path = external/pybison
path = external/pybison
url = git@kompiler.org:python/pybison
url = git@kompiler.org:python/pybison
[submodule "external/graph_drawing"]
path = external/graph_drawing
url = git@kompiler.org:python/graph_drawing
graph_drawing
@
1d05417a
Subproject commit 1d05417ac83c39ec3a75486ee842e8195565d75a
src/calc.py
View file @
bd3112ba
...
@@ -228,3 +228,6 @@ class Parser(BisonParser):
...
@@ -228,3 +228,6 @@ class Parser(BisonParser):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
p
=
Parser
(
verbose
=
0
,
keepfiles
=
1
,
interactive
=
1
)
p
=
Parser
(
verbose
=
0
,
keepfiles
=
1
,
interactive
=
1
)
p
.
run
(
debug
=
0
)
p
.
run
(
debug
=
0
)
# Clear the line, when the shell exits.
print
tests/rules.mk
View file @
bd3112ba
TESTS
=
$(
wildcard
tests/test_
*
.py
)
TESTS
=
$(
wildcard
tests/test_
*
.py
)
COVERAGE_OUTPUT_DIR
:=
coverage
COVERAGE_OUTPUT_DIR
:=
coverage
OMIT
:=
--omit
/usr/share/pyshared/
*
,/usr/lib64/portage/
*
OMIT
:=
--omit
/usr/share/pyshared/
*
ifeq
($(findstring python-coverage,$(wildcard /usr/bin/*)), python-coverage)
ifeq
($(findstring python-coverage,$(wildcard /usr/bin/*)), python-coverage)
COVERAGE
=
/usr/bin/python-coverage
COVERAGE
=
/usr/bin/python-coverage
...
...
tests/test_calc.py
View file @
bd3112ba
...
@@ -27,8 +27,8 @@ class TestCalc(unittest.TestCase):
...
@@ -27,8 +27,8 @@ class TestCalc(unittest.TestCase):
def
test_infinity
(
self
):
def
test_infinity
(
self
):
expressions
=
[(
'2^3000'
,
2
**
3000
),
expressions
=
[(
'2^3000'
,
2
**
3000
),
(
'2^-3000'
,
0.0
)
,
(
'2^-3000'
,
0.0
)
]
(
'2^99999999999'
,
None
),
#
('2^99999999999', None),
(
'2^-99999999999'
,
0.0
)]
#
('2^-99999999999', 0.0)]
run_expressions
(
expressions
,
fail
=
False
)
run_expressions
(
expressions
)
tests/test_variables.py
View file @
bd3112ba
...
@@ -13,8 +13,12 @@ class TestVariables(unittest.TestCase):
...
@@ -13,8 +13,12 @@ class TestVariables(unittest.TestCase):
pass
pass
def
test_addition
(
self
):
def
test_addition
(
self
):
expressions
=
[(
'5 + 5'
,
5
+
5
)]
run_expressions
(
expressions
)
def
test_addition_of_one_term
(
self
):
a
=
Symbol
(
'a'
)
a
=
Symbol
(
'a'
)
expressions
=
[(
'a + 5'
,
a
+
5
)]
expressions
=
[(
'a + 5'
,
5
+
a
)]
run_expressions
(
expressions
)
run_expressions
(
expressions
)
def
test_addition_of_two_terms
(
self
):
def
test_addition_of_two_terms
(
self
):
...
...
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