Fixed "return break" bug in fall-through case statements (thanks to Scott Bell for...
[parenscript.git] / t / eval-tests.lisp
blob5f1bc2fd47581a30d30e986b1e4d8668fef351a5
1 ;; Copying and distribution of this file, with or without
2 ;; modification, are permitted in any medium without royalty. This
3 ;; file is offered as-is, without any warranty.
5 (in-package #:ps-eval-tests)
6 (named-readtables:in-readtable :parenscript)
8 (in-suite ps-test::eval-tests)
10 (test-js-eval number
14 (test-js-eval float
15 (< 123.12 123.123 123.124)
18 (test-js-eval string
19 "foobar"
20 "foobar")
22 (test-js-eval statements-and-expressions-2
23 ((lambda () (if 1 2 3)))
26 (test-js-eval statements-and-expressions-1
27 ((lambda () (+ 2 (if 1 2 3))))
30 (test-js-eval empty-array
31 (array)
32 (js-array (make-array 0 :adjustable t)))
34 (test-js-eval funargs-let1
35 ((lambda (x)
36 (let ((x 10))
37 (incf x))
38 (incf x)) 0)
41 (test-js-eval block-dynamic-return
42 (block nil ((lambda () (return))) (+ 1 2))
43 :null)
45 (test-js-eval times-rem
46 (* 12 (rem 10 3))
47 12)
49 (test-js-eval divide-rem
50 (rem 10 (/ 12 4))
53 (test-js-eval rem-divide
54 (/ 9 (rem 11 4))
57 (test-js-eval rem-multiply
58 (* 5 (rem 4 3))
61 (test-js-eval case-return-break-null
62 ((lambda (x) (case x (1) (2 3))) 1)
63 :null)