aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-10 17:54:59 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-10 17:54:59 -0800
commit41e3ba8e82863a75d3b81fdad9ebef319a4ac652 (patch)
tree59dade1777786a4f99a8f05ffeeb44520184f714 /tests/runner.py
parent0a71c5438c46d535cc714b927ae328563d76eba6 (diff)
experimental tool to fix closure's over-inlining into FUNCTION_TABLE
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 22e8ff1d..6d2ad423 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -5468,6 +5468,14 @@ f.close()
output = Popen([NODE_JS, COFFEESCRIPT, VARIABLE_ELIMINATOR], stdin=PIPE, stdout=PIPE).communicate(input)[0]
self.assertIdentical(expected, output)
+ def test_fix_closure(self):
+ input = path_from_root('tests', 'test-fix-closure.js')
+ expected = path_from_root('tests', 'test-fix-closure.out.js')
+ Popen(['python', path_from_root('tools', 'fix_closure.py'), input, 'out.js']).communicate(input)
+ output = open('out.js').read()
+ assert '0,uninline_Q_269,0' in output
+ assert run_js(input) == run_js('out.js')
+
def test_js_optimizer(self):
for input, expected, passes in [
(open(path_from_root('tools', 'test-js-optimizer.js')).read(), open(path_from_root('tools', 'test-js-optimizer-output.js')).read(),