1 USING: alien ui.gadgets.panes ui.gadgets namespaces
2 kernel sequences io io.styles io.streams.string tools.test
3 prettyprint definitions help help.syntax help.markup
4 help.stylesheet splitting tools.test.ui models math summary
6 IN: ui.gadgets.panes.tests
8 : #children "pane" get children>> length ;
10 [ ] [ <pane> "pane" set ] unit-test
12 [ ] [ #children "num-children" set ] unit-test
15 "pane" get <pane-stream> [ 100 [ . ] each ] with-output-stream*
18 [ t ] [ #children "num-children" get = ] unit-test
21 dup make-pane gadget-text dup print "======" print
22 swap with-string-writer dup print "\n" ?tail drop "\n" ?tail drop = ;
24 [ t ] [ [ "hello" write ] test-gadget-text ] unit-test
25 [ t ] [ [ "hello" pprint ] test-gadget-text ] unit-test
28 H{ { wrap-margin 100 } } [ "hello" pprint ] with-nesting
33 H{ { wrap-margin 100 } } [
40 [ t ] [ [ [ 1 2 3 ] pprint ] test-gadget-text ] unit-test
41 [ t ] [ [ \ + describe ] test-gadget-text ] unit-test
42 [ t ] [ [ \ = see ] test-gadget-text ] unit-test
43 [ t ] [ [ \ = print-topic ] test-gadget-text ] unit-test
76 [ "Hello world" write ] ($block)
82 ARTICLE: "test-article-1" "This is a test article"
83 "Hello world, how are you today." ;
85 [ t ] [ [ "test-article-1" $title ] test-gadget-text ] unit-test
87 [ t ] [ [ "test-article-1" print-topic ] test-gadget-text ] unit-test
89 ARTICLE: "test-article-2" "This is a test article"
90 "Hello world, how are you today."
91 { $table { "a" "b" } { "c" "d" } } ;
93 [ t ] [ [ "test-article-2" print-topic ] test-gadget-text ] unit-test
95 <pane> [ \ = see ] with-pane
96 <pane> [ \ = print-topic ] with-pane
99 \ = <model> [ see ] <pane-control> [ ] with-grafted-gadget