2009-01-11 18:52:31 -05:00
|
|
|
! Copyright (C) 2009 Jose Antonio Ortega Ruiz.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2017-01-08 07:18:50 -05:00
|
|
|
USING: continuations fuel fuel.eval io.streams.string kernel math
|
2017-01-08 07:41:43 -05:00
|
|
|
namespaces random.data sequences strings tools.test vocabs.parser ;
|
2009-01-11 18:52:31 -05:00
|
|
|
IN: fuel.eval.tests
|
2014-10-10 13:45:13 -04:00
|
|
|
|
2017-01-08 07:18:50 -05:00
|
|
|
! pop-restarts
|
|
|
|
{ V{ "um" } } [
|
|
|
|
fuel-eval-non-restartable V{ } clone restarts set-global
|
|
|
|
V{ "um" } pop-restarts
|
|
|
|
restarts get-global
|
|
|
|
V{ } clone restarts set-global
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! push-status
|
|
|
|
{ 1 } [
|
|
|
|
V{ } clone [ status-stack set-global ] keep push-status
|
|
|
|
length
|
|
|
|
pop-status
|
|
|
|
] unit-test
|
|
|
|
|
2014-10-10 13:45:13 -04:00
|
|
|
! Make sure prettyprint doesn't limit output.
|
|
|
|
{ t } [
|
2017-01-08 07:18:50 -05:00
|
|
|
1000 random-string eval-result set-global
|
|
|
|
[ send-retort ] with-string-writer length 1000 >
|
|
|
|
f eval-result set-global
|
2014-10-10 13:45:13 -04:00
|
|
|
] unit-test
|
2017-01-07 09:20:13 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
"(nil \"IN: kernel PRIMITIVE: dup ( x -- x x )\" \"\")\n<~FUEL~>\n"
|
|
|
|
} [
|
|
|
|
[
|
2017-01-08 07:41:43 -05:00
|
|
|
[
|
|
|
|
V{ "\"dup\"" "fuel-word-synopsis" } "scratchpad"
|
|
|
|
V{ "fuel" "kernel" "syntax" } eval-in-context
|
|
|
|
] with-string-writer
|
|
|
|
f eval-result set-global
|
|
|
|
] with-manifest
|
2017-01-07 09:20:13 -05:00
|
|
|
] unit-test
|