def test_load(): pwd = py.path.local(__file__) js_file = str(pwd.dirpath("test_load.js")) assertv("load('" + js_file + "'); x;", 1)
def test_infinity_nan(): assertv('1/0', 'Infinity') assertv('0/0', 'NaN') assertv('-1/0', '-Infinity')
def test_overflow_int_to_float(): assertv('1e200', '1e+200')
def test_variable_deletion(): assertv("var x = 3; delete this.x;", False) assertv("x = 3; delete this.x;", True) assertv("var x = 3; delete this.x; x", 3)