Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
parenscript
parenscript
Commits
1c2d80ef
Verified
Commit
1c2d80ef
authored
Oct 26, 2018
by
Vladimir Sedach
Browse files
Misc. unit tests
parent
e120af64
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/eval-tests.lisp
View file @
1c2d80ef
...
...
@@ -573,22 +573,6 @@
(
otherwise
7
)))
6
)
;;; needs MV pass-through to work
;; (test-js-eval multiple-value-call-twice
;; (progn
;; (defun foo (x &optional y z)
;; (if z
;; (values x y z)
;; (values x y)))
;; (defun bar ()
;; (foo 1 2 3)
;; (foo 4 5))
;; (multiple-value-bind (a b c) (bar)
;; (list a b c)))
;; '(4 5 :undefined))
(
test-js-eval
recursive-values
(
progn
(
defun
foo
(
x
)
...
...
@@ -1047,3 +1031,37 @@
(
loop
if
t
return
10
)))
(
foobar
))
10
)
(
test-js-eval
this-passthrough-generated-lambdas
(
let
((
obj
(
ps:create
x
3
)))
(
setf
(
ps:getprop
obj
'foo
)
(
lambda
()
(
1+
(
loop
repeat
10
return
(
ps:getprop
ps:this
'x
)))))
(
funcall
(
ps:getprop
obj
'foo
)))
4
)
;;; Multiple value cases that are currently unimplemented
;; (test-js-eval multiple-value-call-twice
;; (progn
;; (defun foo (x &optional y z)
;; (if z
;; (values x y z)
;; (values x y)))
;; (defun bar ()
;; (foo 1 2 3)
;; (foo 4 5))
;; (multiple-value-bind (a b c) (bar)
;; (list a b c)))
;; '(4 5 :undefined))
;; (test-js-eval multiple-value-bind-nested
;; (multiple-value-bind (x y)
;; ((lambda ()
;; (multiple-value-bind (a b)
;; (values 1 2)
;; (values b a))))
;; (list x y))
;; '(2 1))
tests/output-tests.lisp
View file @
1c2d80ef
...
...
@@ -4365,3 +4365,17 @@ x = 2 + sideEffect() + x + 5;")
};
return foo();
})();"
)
(
test-ps-js
for-loop-var-init-let
(
lambda
(
y
)
(
ps:for
((
x
(
let
((
x0
(
foo
y
)))
(
bar
x0
))))
()
()
(
xyzzy
x
)))
"(function (y) {
var x0;
for (var x = (x0 = foo(y), bar(x0)); ; ) {
xyzzy(x);
};
});"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment