summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorKacper Michajłow <[email protected]>2016-11-05 06:11:51 +0100
committerKacper Michajłow <[email protected]>2016-11-11 15:36:57 +0100
commit189935f15960300d316e8b07108b076ac6c2186a (patch)
treee6a41b6feebe5a29ea18e30308d0202b460d71a7 /test
parentbc40b3a5ba44006c23daf7fe0ed872af5e33bdc5 (diff)
downloadyoutube-dl-189935f15960300d316e8b07108b076ac6c2186a.tar.gz
youtube-dl-189935f15960300d316e8b07108b076ac6c2186a.zip
[jsinterp] Fix function calls without arguments.
Diffstat (limited to 'test')
-rw-r--r--test/test_jsinterp.py7
1 files changed, 7 insertions, 0 deletions
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()