]> gitweb.factorcode.org Git - factor.git/blob - extra/ui/gadgets/panes/panes-tests.factor
Initial import
[factor.git] / extra / ui / gadgets / panes / panes-tests.factor
1 IN: temporary
2 USING: alien ui.gadgets.panes ui.gadgets namespaces
3 kernel sequences io io.streams.string tools.test prettyprint
4 definitions help help.syntax help.markup splitting ;
5
6 : #children "pane" get gadget-children length ;
7
8 [ ] [ <pane> "pane" set ] unit-test
9
10 [ ] [ #children "num-children" set ] unit-test
11
12 [ ] [
13     "pane" get <pane-stream> [ 10000 [ . ] each ] with-stream*
14 ] unit-test
15
16 [ t ] [ #children "num-children" get = ] unit-test
17
18 : test-gadget-text
19     dup make-pane gadget-text
20     swap string-out "\n" ?tail drop "\n" ?tail drop = ;
21
22 [ t ] [ [ "hello" write ] test-gadget-text ] unit-test
23 [ t ] [ [ "hello" pprint ] test-gadget-text ] unit-test
24 [ t ] [ [ [ 1 2 3 ] pprint ] test-gadget-text ] unit-test
25 [ t ] [ [ \ = see ] test-gadget-text ] unit-test
26 [ t ] [ [ \ = help ] test-gadget-text ] unit-test
27
28 ARTICLE: "test-article" "This is a test article"
29 "Hello world, how are you today."
30 { $table { "a" "b" } { "c" "d" } } ;
31
32 [ t ] [ [ "test-article" help ] test-gadget-text ] unit-test
33
34 <pane> [ \ = see ] with-pane
35 <pane> [ \ = help ] with-pane