Added unit tests and script to view profiler stats.

parent 430573e3
graph_drawing @ 4d65a52b
Subproject commit a34e48940a4eab2d44db8bdc61ff56648e2e087e Subproject commit 4d65a52b8ba0f0ad1843cb5535a485ff372317a3
pybison @ 2ae8c15d
Subproject commit 1bd7873dfad2fabac51fab8ed978374502f09034 Subproject commit 2ae8c15dba13faba38e1a3d1a711cf6d24395a5a
...@@ -53,6 +53,17 @@ class TestCalc(unittest.TestCase): ...@@ -53,6 +53,17 @@ class TestCalc(unittest.TestCase):
('ab(c)d', N('*', L('a'), L('b'), L('c'), L('d'))), ('ab(c)d', N('*', L('a'), L('b'), L('c'), L('d'))),
#('ab(c)d', N('*', L('a'), N('*', L('b'), #('ab(c)d', N('*', L('a'), N('*', L('b'),
# N('*', L('c'), L('d'))))), # N('*', L('c'), L('d'))))),
('ab*(c)*d', N('*', L('a'), L('b'), L('c'), L('d'))),
('ab*(c)^d', N('*', L('a'), L('b'),
N('^', L('c'), L('d')))),
]
run_expressions(Parser, expressions)
def test_pow_nested(self):
# a^b^c = a^(b^c) != (a^b)^c
expressions = [
('a^b^c', N('^', L('a'), N('^', L('b'), L('c')))),
] ]
run_expressions(Parser, expressions) run_expressions(Parser, expressions)
#!/usr/bin/python
import sys
from pstats import Stats
s = Stats(sys.argv[1])
for profile in sys.argv[2:]:
s.add(profile)
s.sort_stats('cumulative')
s.print_stats()
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