[pypy-svn] r39626 - pypy/dist/pypy/lang/js/test
santagada at codespeak.net
santagada at codespeak.net
Thu Mar 1 12:47:26 CET 2007
Author: santagada
Date: Thu Mar 1 12:47:23 2007
New Revision: 39626
Removed:
pypy/dist/pypy/lang/js/test/autotestbase.py
Modified:
pypy/dist/pypy/lang/js/test/test_parser.py
Log:
started testing the parser again
Modified: pypy/dist/pypy/lang/js/test/test_parser.py
==============================================================================
--- pypy/dist/pypy/lang/js/test/test_parser.py (original)
+++ pypy/dist/pypy/lang/js/test/test_parser.py Thu Mar 1 12:47:23 2007
@@ -2,30 +2,9 @@
from pypy.lang.js.test.test_interp import js_is_on_path
import py
-py.test.skip("FIX ME: new tests for the new parser")
js_is_on_path()
-def test_read_js_output():
- assert read_js_output("1+1").find("PLUS") > -1
- assert read_js_output("""
- function f(x) {
- return (x);
- }
- """).find("RETURN") != -1
- py.test.raises(JsSyntaxError, "read_js_output(\"1+\")")
- py.test.raises(JsSyntaxError, "read_js_output(\"xx xxx\")")
-
-def test_simple_parse():
- data = parse("1+1")
- assert data['type'] == 'SCRIPT'
- assert data['0']['type'] == 'SEMICOLON'
- data = parse("function s(x) { return 1;}")
- assert data['0']['body']['0']['value']['value'] == '1'
- assert sorted(data.keys()) == ['0', 'funDecls', 'length', 'lineno', \
- 'tokenizer', 'type', 'varDecls']
-
-def test_single_quote():
- "test if parser eats single quotes"
- data = parse("x = '2'")
- assert data['type'] == 'SCRIPT'
+def test_quoting():
+ read_js_output('x = "\'"')
+ read_js_output('x = "\\\\"')
\ No newline at end of file
More information about the Pypy-commit
mailing list