mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
more ecmascript testing
* test-suite/tests/ecmascript.test (eread/1, parse): Also check read-ecmascript/1, which uses tokenize/1.
This commit is contained in:
parent
a608cad27e
commit
e92f113a5e
1 changed files with 7 additions and 2 deletions
|
@ -24,12 +24,17 @@
|
||||||
|
|
||||||
(define (eread str)
|
(define (eread str)
|
||||||
(call-with-input-string str read-ecmascript))
|
(call-with-input-string str read-ecmascript))
|
||||||
|
(define (eread/1 str)
|
||||||
|
(call-with-input-string str read-ecmascript/1))
|
||||||
|
|
||||||
(define-syntax parse
|
(define-syntax parse
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ expression expected)
|
((_ expression expected)
|
||||||
|
(begin
|
||||||
(pass-if expression
|
(pass-if expression
|
||||||
(equal? expected (eread expression))))))
|
(equal? expected (eread expression)))
|
||||||
|
(pass-if expression
|
||||||
|
(equal? expected (eread/1 expression)))))))
|
||||||
|
|
||||||
(with-test-prefix "parser"
|
(with-test-prefix "parser"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue