]> jfr.im git - yt-dlp.git/blobdiff - test/test_jsinterp.py
[skip travis] renaming
[yt-dlp.git] / test / test_jsinterp.py
index 63c350b8fa986fc63d70af43a6a0fdcaf5958eed..97fc8d5aa88626f569126dbdba2a21828743cfdc 100644 (file)
@@ -8,7 +8,7 @@
 import unittest
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from youtube_dl.jsinterp import JSInterpreter
+from youtube_dlc.jsinterp import JSInterpreter
 
 
 class TestJSInterpreter(unittest.TestCase):
@@ -104,6 +104,14 @@ def test_precedence(self):
         }''')
         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()