1 USING: assocs ui.tools.search help.topics io.pathnames io.styles
2 kernel namespaces sequences source-files threads
3 tools.test ui.gadgets ui.gestures vocabs accessors
4 vocabs.loader words tools.test.ui debugger calendar ;
5 IN: ui.tools.search.tests
8 "no such word with this name exists, certainly"
9 f f <definition-search>
10 T{ key-down f { C+ } "x" } swap search-gesture
13 : assert-non-empty ( obj -- ) empty? f assert= ;
15 : update-live-search ( search -- seq )
17 300 milliseconds sleep
19 ] with-grafted-gadget ;
21 : test-live-search ( gadget quot -- ? )
22 [ update-live-search dup assert-non-empty ] dip all? ;
25 "swp" all-words f <definition-search>
26 [ word? ] test-live-search
30 "" all-words t <definition-search>
32 { "set-word-prop" } over field>> set-control-value
33 300 milliseconds sleep
34 search-value \ set-word-prop eq?
40 [ link? ] test-live-search
44 "factor" source-files get keys <source-file-search>
45 [ pathname? ] test-live-search
50 [ vocab-spec? ] test-live-search
54 "a" { "a" "b" "aa" } <history-search>
55 [ input? ] test-live-search