Fix interactor
parent
48a16b542d
commit
a1b050fd88
|
@ -1,4 +1,27 @@
|
|||
IN: ui.tools.interactor.tests
|
||||
USING: ui.tools.interactor tools.test ;
|
||||
USING: ui.tools.interactor ui.gadgets.panes namespaces
|
||||
ui.gadgets.editors concurrency.promises threads listener
|
||||
tools.test kernel calendar ;
|
||||
|
||||
\ <interactor> must-infer
|
||||
|
||||
[ ] [ <pane> <pane-stream> <interactor> "interactor" set ] unit-test
|
||||
|
||||
[ ] [ "[ 1 2 3" "interactor" get set-editor-string ] unit-test
|
||||
|
||||
[ ] [ <promise> "promise" set ] unit-test
|
||||
|
||||
[
|
||||
"interactor" get stream-read-quot "promise" get fulfill
|
||||
] "Interactor test" spawn drop
|
||||
|
||||
! This should not throw an exception
|
||||
[ ] [ "interactor" get evaluate-input ] unit-test
|
||||
|
||||
[ ] [ [ "interactor" get interactor-busy? ] [ yield ] [ ] while ] unit-test
|
||||
|
||||
[ ] [ "[ 1 2 3 ]" "interactor" get set-editor-string ] unit-test
|
||||
|
||||
[ ] [ "interactor" get evaluate-input ] unit-test
|
||||
|
||||
[ [ [ 1 2 3 ] ] ] [ "promise" get 5 seconds ?promise-timeout ] unit-test
|
||||
|
|
|
@ -138,7 +138,9 @@ M: interactor stream-read-partial
|
|||
drop parse-lines-interactive
|
||||
] [
|
||||
2nip
|
||||
dup delegate unexpected-eof? [ drop f ] when
|
||||
dup parse-error? [
|
||||
dup error>> unexpected-eof? [ drop f ] when
|
||||
] when
|
||||
] recover ;
|
||||
|
||||
: handle-interactive ( lines interactor -- quot/f ? )
|
||||
|
|
Loading…
Reference in New Issue