From d89c2137ba4c1def185358a9ff48642e05ac65a2 Mon Sep 17 00:00:00 2001 From: dirkf Date: Fri, 19 May 2023 13:09:18 +0100 Subject: [jsinterp] Small updates for a85a875 * update signature tests * clarify NaN handling --- test/test_jsinterp.py | 3 +++ test/test_youtube_signature.py | 8 ++++++++ 2 files changed, 11 insertions(+) (limited to 'test') diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py index a8f312fde..1cc148b15 100644 --- a/test/test_jsinterp.py +++ b/test/test_jsinterp.py @@ -516,6 +516,9 @@ class TestJSInterpreter(unittest.TestCase): jsi = JSInterpreter('function x(){return 42 << NaN}') self.assertEqual(jsi.call_function('x'), 42) + jsi = JSInterpreter('function x(){return 42 << Infinity}') + self.assertEqual(jsi.call_function('x'), 42) + def test_32066(self): jsi = JSInterpreter("function x(){return Math.pow(3, 5) + new Date('1970-01-01T08:01:42.000+08:00') / 1000 * -239 - -24205;}") self.assertEqual(jsi.call_function('x'), 70) diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py index decf7ee38..d41d708a0 100644 --- a/test/test_youtube_signature.py +++ b/test/test_youtube_signature.py @@ -143,6 +143,14 @@ _NSIG_TESTS = [ 'https://www.youtube.com/s/player/dac945fd/player_ias.vflset/en_US/base.js', 'o8BkRxXhuYsBCWi6RplPdP', '3Lx32v_hmzTm6A', ), + ( + 'https://www.youtube.com/s/player/6f20102c/player_ias.vflset/en_US/base.js', + 'lE8DhoDmKqnmJJ', 'pJTTX6XyJP2BYw', + ), + ( + 'https://www.youtube.com/s/player/cfa9e7cb/player_ias.vflset/en_US/base.js', + 'qO0NiMtYQ7TeJnfFG2', 'k9cuJDHNS5O7kQ', + ), ] -- cgit 1.4.1