aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsepro <sepro@sepr0.com>2025-02-09 22:37:23 +0100
committerGitHub <noreply@github.com>2025-02-09 22:37:23 +0100
commit4ca8c44a073d5aa3a3e3112c35b2b23d6ce25ac6 (patch)
treee1cf4d5df67a8560a177b34c1e84f55d814dd54b /test
parent241ace4f104d50fdf7638f9203927aefcf57a1f7 (diff)
[jsinterp] Improve zeroise (#12313)
Authored by: seproDev
Diffstat (limited to 'test')
-rw-r--r--test/test_jsinterp.py10
-rw-r--r--test/test_youtube_signature.py4
2 files changed, 14 insertions, 0 deletions
diff --git a/test/test_jsinterp.py b/test/test_jsinterp.py
index c1464f2cd..ed3ca61c4 100644
--- a/test/test_jsinterp.py
+++ b/test/test_jsinterp.py
@@ -93,6 +93,16 @@ class TestJSInterpreter(unittest.TestCase):
self._test('function f(){return 0 ?? 42;}', 0)
self._test('function f(){return "life, the universe and everything" < 42;}', False)
self._test('function f(){return 0 - 7 * - 6;}', 42)
+ self._test('function f(){return true << "5";}', 32)
+ self._test('function f(){return true << true;}', 2)
+ self._test('function f(){return "19" & "21.9";}', 17)
+ self._test('function f(){return "19" & false;}', 0)
+ self._test('function f(){return "11.0" >> "2.1";}', 2)
+ self._test('function f(){return 5 ^ 9;}', 12)
+ self._test('function f(){return 0.0 << NaN}', 0)
+ self._test('function f(){return null << undefined}', 0)
+ # TODO: Does not work due to number too large
+ # self._test('function f(){return 21 << 4294967297}', 42)
def test_array_access(self):
self._test('function f(){var x = [1,2,3]; x[0] = 4; x[0] = 5; x[2.0] = 7; return x;}', [5, 2, 7])
diff --git a/test/test_youtube_signature.py b/test/test_youtube_signature.py
index 13436f088..7ae627f2c 100644
--- a/test/test_youtube_signature.py
+++ b/test/test_youtube_signature.py
@@ -201,6 +201,10 @@ _NSIG_TESTS = [
'https://www.youtube.com/s/player/2f1832d2/player_ias.vflset/en_US/base.js',
'YWt1qdbe8SAfkoPHW5d', 'RrRjWQOJmBiP',
),
+ (
+ 'https://www.youtube.com/s/player/9c6dfc4a/player_ias.vflset/en_US/base.js',
+ 'jbu7ylIosQHyJyJV', 'uwI0ESiynAmhNg',
+ ),
]