From 189935f15960300d316e8b07108b076ac6c2186a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sat, 5 Nov 2016 06:11:51 +0100 Subject: [jsinterp] Fix function calls without arguments. --- test/test_jsinterp.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/test_jsinterp.py') diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 63c350b8f..a9abae5f5 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -104,6 +104,13 @@ class TestJSInterpreter(unittest.TestCase): }''') self.assertEqual(jsi.call_function('x'), [20, 20, 30, 40, 50]) + def test_call(self): + jsi = JSInterpreter(''' + function x() { return 2; } + function y(a) { return x() + a; } + function z() { return y(3); } + ''') + self.assertEqual(jsi.call_function('z'), 5) if __name__ == '__main__': unittest.main() -- cgit v1.2.3