Skip to content

Commit

Permalink
ui.traverse: cleanup tests a little.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Oct 26, 2017
1 parent e06b1d7 commit da0ca21
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions basis/ui/traverse/traverse-tests.factor
@@ -1,19 +1,17 @@
USING: accessors ui.gadgets ui.gadgets.labels namespaces make
sequences kernel math arrays tools.test io ui.gadgets.panes
ui.traverse definitions compiler.units ;
USING: accessors arrays compiler.units definitions kernel make
sequences tools.test ui.traverse ;
IN: ui.traverse.tests

M: array children>> ;

GENERIC: (flatten-tree) ( node -- )
GENERIC: flatten-tree% ( node -- )

M: node (flatten-tree)
children>> [ (flatten-tree) ] each ;
M: node flatten-tree% children>> [ flatten-tree% ] each ;

M: object (flatten-tree) , ;
M: object flatten-tree% , ;

: flatten-tree ( seq -- newseq )
[ [ (flatten-tree) ] each ] { } make ;
[ [ flatten-tree% ] each ] { } make ;

: gadgets-in-range ( frompath topath gadget -- seq )
gadget-subtree flatten-tree ;
Expand Down

0 comments on commit da0ca21

Please sign in to comment.