X-Git-Url: http://git.hcoop.net/bpt/guile.git/blobdiff_plain/b1846b7fb31de1bbe126322688ac109fd86a924e..c9d55a7e4ec079a735af40df6e652db5585e6826:/test-suite/tests/ecmascript.test diff --git a/test-suite/tests/ecmascript.test b/test-suite/tests/ecmascript.test index e96d383a4..96b1d6666 100644 --- a/test-suite/tests/ecmascript.test +++ b/test-suite/tests/ecmascript.test @@ -1,6 +1,6 @@ ;;;; ecmascript.test --- ECMAScript. -*- mode: scheme; coding: utf-8; -*- ;;;; -;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 2010, 2011, 2013 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -40,6 +40,7 @@ (parse "true;" 'true) (parse "2 + 2;" '(+ (number 2) (number 2))) + (parse "2\xa0+2;" '(+ (number 2) (number 2))) ; U+00A0 is whitespace (parse "\"hello\";" '(string "hello")) (parse "function square(x) { return x * x; }" '(var (square (lambda (x) (return (* (ref x) (ref x))))))) @@ -52,7 +53,11 @@ (parse "\"\\x12\";" ; Latin-1 escape in string literal '(string "\x12")) (parse "\"\\u1234\";" ; Unicode escape in string literal - '(string "\u1234"))) + '(string "\u1234")) + (parse "function foo(x) { }" ; empty function body + '(var (foo (lambda (x) (begin))))) + (parse ".123;" '(number 0.123)) + (parse "0xff;" '(number 255))) (define-syntax ecompile @@ -73,6 +78,7 @@ (with-test-prefix "compiler" (ecompile "true;" #t) + (ecompile "if (3 > 2) true; else false;" #t) (ecompile "2 + 2;" 4) (ecompile "\"hello\";" "hello") (ecompile "var test = { bar: 1 };")