]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/trace/trace-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / basis / tools / trace / trace-tests.factor
1 IN: tools.trace.tests
2 USING: tools.trace tools.test tools.continuations kernel math combinators
3 sequences ;
4
5 { { 3 2 1 } } [ { 1 2 3 } [ reverse ] trace ] unit-test
6
7 GENERIC: method-breakpoint-test ( x -- y )
8
9 TUPLE: method-breakpoint-tuple ;
10
11 M: method-breakpoint-tuple method-breakpoint-test break drop 1 2 + ;
12
13 \ method-breakpoint-test don't-step-into
14
15 { 3 }
16 [ [ T{ method-breakpoint-tuple } method-breakpoint-test ] trace ] unit-test
17
18 : case-breakpoint-test ( -- x )
19     5 { [ break 1 + ] } case ;
20
21 \ case-breakpoint-test don't-step-into
22
23 { 6 } [ [ case-breakpoint-test ] trace ] unit-test
24
25 : call(-breakpoint-test ( -- x )
26     [ break 1 ] call( -- x ) 2 + ;
27
28 \ call(-breakpoint-test don't-step-into
29
30 { 3 } [ [ call(-breakpoint-test ] trace ] unit-test