X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=test%2Ftest_jsinterp.py;h=c24b8ca742acc308ca9c455378564bbac053765d;hb=41bf647e895faca42cdc2565ea034ed341593f8e;hp=63c350b8fa986fc63d70af43a6a0fdcaf5958eed;hpb=31d9ea4a3e641acfee8852c9324bd414047fce9e;p=youtube-dl diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index 63c350b8f..c24b8ca74 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -104,6 +104,14 @@ 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()