aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2025-04-04 12:29:28 +0100
committerdirkf <fieldhouse@gmx.net>2025-04-08 01:59:00 +0100
commitbd2ded59f218bed637514f3aaf11787fa7b87ccf (patch)
treef4f052339443cbd59342fb26ce908088c0faf817 /test
parent16b7e97afad2ed73c2d01a55987cb323407ca1c4 (diff)
[JSInterp] Improve unary operators; add `!`
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 30c48adfc..95bac75d7 100644
--- a/test/test_jsinterp.py
+++ b/test/test_jsinterp.py
@@ -371,6 +371,13 @@ class TestJSInterpreter(unittest.TestCase):
self._test('function f() { a=5; return (a -= 1, a+=3, a); }', 7)
self._test('function f() { return (l=[0,1,2,3], function(a, b){return a+b})((l[1], l[2]), l[3]) }', 5)
+ def test_not(self):
+ self._test('function f() { return ! undefined; }', True)
+ self._test('function f() { return !0; }', True)
+ self._test('function f() { return !!0; }', False)
+ self._test('function f() { return ![]; }', False)
+ self._test('function f() { return !0 !== false; }', True)
+
def test_void(self):
self._test('function f() { return void 42; }', JS_Undefined)