Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
parenscript
parenscript
Commits
116019cf
Verified
Commit
116019cf
authored
Oct 15, 2018
by
Vladimir Sedach
Browse files
Added misc unit tests
parent
59d82b98
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/eval-tests.lisp
View file @
116019cf
...
...
@@ -779,3 +779,24 @@
(
test-js-eval
dotimes-block-return
(
1+
(
dotimes
(
x
3
)
(
if
(
=
x
2
)
(
return
(
+
x
x
)))))
5
)
(
test-js-eval
labels-factorial
(
progn
(
defun
fac
(
n
)
(
labels
((
f
(
n
a
)
(
if
(
<
n
2
)
a
(
f
(
-
n
1
)
(
*
n
a
)))))
(
f
n
1
)))
(
fac
5
))
120
)
(
test-js-eval
destructuring-bind1
((
lambda
(
a
)
(
when
a
(
destructuring-bind
(
b
.
c
)
a
(
list
b
c
))))
'
(
1
2
3
))
'
(
1
(
2
3
)))
tests/output-tests.lisp
View file @
116019cf
...
...
@@ -2512,9 +2512,8 @@ return x;
(
test-ps-js
return-macrolet1
(
defun
foo
()
(
return-from
foo
(
symbol-macrolet
((
x
2
))
(
loop
do
(
+
x
x
)))))
(
symbol-macrolet
((
x
2
))
(
loop
do
(
+
x
x
))))
"function foo() {
while (true) {
2 + 2;
...
...
@@ -2704,6 +2703,21 @@ try {
};
};"
)
(
test-ps-js
try-finally-return-from
(
defun
xyz
()
(
return-from
xyz
(
ps:try
(
when
(
blah
)
4
)
(
:finally
(
foo
))))
(
dont-call-me
))
"function xyz() {
try {
return blah() ? 4 : null;
} finally {
foo();
};
return dontCallMe();
};"
)
(
test-ps-js
defun-setf-optional
(
defun
(
setf
foo
)
(
new-value
b
&optional
c
)
(
setf
(
aref
b
(
or
c
0
))
new-value
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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