Adding walker tests

db4
Slava Pestov 2009-04-16 23:14:26 -05:00
parent 0a5b076c11
commit e173d27120
3 changed files with 27 additions and 3 deletions

View File

@ -79,3 +79,5 @@ M: trace-step summary
[ [ trace-step ] break-hook ] dip [ [ trace-step ] break-hook ] dip
[ break ] [ end drop ] surround [ break ] [ end drop ] surround
with-variable ; with-variable ;
<< \ trace t "no-compile" set-word-prop >>

View File

@ -1,7 +1,8 @@
USING: tools.walker io io.streams.string kernel math USING: tools.walker io io.streams.string kernel math
math.private namespaces prettyprint sequences tools.test math.private namespaces prettyprint sequences tools.test
continuations math.parser threads arrays tools.walker.debug continuations math.parser threads arrays tools.walker.debug
generic.standard sequences.private kernel.private ; generic.standard sequences.private kernel.private
tools.continuations accessors words ;
IN: tools.walker.tests IN: tools.walker.tests
[ { } ] [ [ { } ] [
@ -112,3 +113,22 @@ IN: tools.walker.tests
[ { } ] [ [ { } ] [
[ "a" "b" set "c" "d" set [ ] test-walker ] with-scope [ "a" "b" set "c" "d" set [ ] test-walker ] with-scope
] unit-test ] unit-test
: breakpoint-test ( -- x ) break 1 2 + ;
\ breakpoint-test don't-step-into
[ f ] [ \ breakpoint-test optimized>> ] unit-test
[ { 3 } ] [ [ breakpoint-test ] test-walker ] unit-test
GENERIC: method-breakpoint-test ( x -- y )
TUPLE: method-breakpoint-tuple ;
M: method-breakpoint-tuple method-breakpoint-test break drop 1 2 + ;
\ method-breakpoint-test don't-step-into
[ { 3 } ]
[ [ T{ method-breakpoint-tuple } method-breakpoint-test ] test-walker ] unit-test

View File

@ -5,7 +5,7 @@ sequences math namespaces.private continuations.private
concurrency.messaging quotations kernel.private words concurrency.messaging quotations kernel.private words
sequences.private assocs models models.arrow arrays accessors sequences.private assocs models models.arrow arrays accessors
generic generic.standard definitions make sbufs generic generic.standard definitions make sbufs
tools.continuations ; tools.continuations parser ;
IN: tools.walker IN: tools.walker
SYMBOL: show-walker-hook ! ( status continuation thread -- ) SYMBOL: show-walker-hook ! ( status continuation thread -- )
@ -35,6 +35,8 @@ DEFER: start-walker-thread
: walk ( quot -- quot' ) : walk ( quot -- quot' )
\ break prefix [ break rethrow ] recover ; \ break prefix [ break rethrow ] recover ;
<< \ walk t "no-compile" set-word-prop >>
break-hook [ break-hook [
[ [
get-walker-thread get-walker-thread
@ -159,4 +161,4 @@ SYMBOL: +stopped+
! For convenience ! For convenience
IN: syntax IN: syntax
: B ( -- ) break ; SYNTAX: B \ break parsed ;