Verified Commit 12afafde authored by Vladimir Sedach's avatar Vladimir Sedach
Browse files

Added a couple of unit tests

parent 12723b29
;;; Copyright 2005 Manuel Odendahl
;;; Copyright 2005-2006 Edward Marco Baringer
;;; Copyright 2006 Luca Capello
;;; Copyright 2007 Red Daly
;;; Copyright 2007-2009 Red Daly
;;; Copyright 2008 Travis Cross
;;; Copyright 2007-2011 Vladimir Sedach
;;; Copyright 2009-2010 Daniel Gackle
......
......@@ -1884,6 +1884,11 @@ return foo(1);
};
};")
(test-ps-js nested-if-expressions3
(foo (if (if x y z) a b)
(if x y (if z a b)))
"foo((x ? y : z) ? a : b, x ? y : (z ? a : b));")
(test-ps-js let1
(let (x)
(+ x x))
......
......@@ -53,6 +53,24 @@
return x + y;
};")
(test-ps-js lib-function2
(defun parenscript.tests.my-library::library-function
(parenscript.tests.my-library::x
&key ((:y parenscript.tests.my-library::z) 1))
(+ parenscript.tests.my-library::x parenscript.tests.my-library::z))
"function my_library_libraryFunction(my_library_x) {
var _js2 = arguments.length;
for (var n1 = 1; n1 < _js2; n1 += 2) {
switch (arguments[n1]) {
case 'y':
my_library_z = arguments[n1 + 1];
};
};
var my_library_z = 'undefined' === typeof my_library_z ? 1 : my_library_z;
return my_library_x + my_library_z;
};")
(test-ps-js uniform-symbol-handling1
(progn (create parenscript.tests.my-library::foo 1)
(getprop foo 'parenscript.tests.my-library::foo))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment