Unit test fixes, and use infer. in UI

slava 2006-11-13 03:40:25 +00:00
parent fc8a1e5160
commit 3c3812e4ad
3 changed files with 18 additions and 8 deletions

View File

@ -1,10 +1,10 @@
IN: temporary
USING: alien compiler errors inference io kernel
kernel-internals math memory namespaces test threads ;
kernel-internals math memory namespaces test threads words ;
: callback-1 "void" { } [ ] alien-callback ;
[ { 0 1 } ] [ [ callback-1 ] infer ] unit-test
[ 0 1 ] [ [ callback-1 ] infer nip dup effect-in swap effect-out ] unit-test
[ t ] [ callback-1 alien? ] unit-test

View File

@ -1,24 +1,27 @@
USING: compiler definitions generic hashtables inference math
namespaces parser test words ;
namespaces parser test words kernel sequences arrays ;
IN: temporary
DEFER: foo \ foo reset-generic
DEFER: bar \ bar reset-generic
: short-effect
dup effect-in length swap effect-out length 2array nip ;
[ ] [ \ foo [ 1 2 ] define-compound ] unit-test
[ { 0 2 } ] [ [ foo ] infer ] unit-test
[ { 0 2 } ] [ [ foo ] infer short-effect ] unit-test
[ ] [ \ foo compile ] unit-test
[ ] [ \ bar [ foo foo ] define-compound ] unit-test
[ ] [ \ bar compile ] unit-test
[ ] [ \ foo [ 1 2 3 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ recompile ] unit-test
[ { 0 3 } ] [ [ foo ] infer ] unit-test
[ { 0 3 } ] [ [ foo ] infer short-effect ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ bar [ 1 2 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ recompile ] unit-test
[ { 0 2 } ] [ [ bar ] infer ] unit-test
[ { 0 2 } ] [ [ bar ] infer short-effect ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ foo [ 1 2 3 ] define-compound ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test

View File

@ -112,6 +112,13 @@ M: operation invoke-command ( target operation -- )
{ +quot+ [ forget ] }
} define-operation
[ word? ] H{
{ +name+ "Word stack effect" }
{ +keyboard+ T{ key-down f { A+ } "i" } }
{ +quot+ [ word-def infer. ] }
{ +listener+ t }
} define-operation
[ word? ] H{
{ +name+ "Word dataflow" }
{ +keyboard+ T{ key-down f { A+ } "d" } }
@ -193,9 +200,9 @@ M: operation invoke-command ( target operation -- )
! Quotations
[ quotation? ] H{
{ +name+ "Infer" }
{ +name+ "Quotation stack effect" }
{ +keyboard+ T{ key-down f { C+ A+ } "i" } }
{ +quot+ [ infer . ] }
{ +quot+ [ infer. ] }
{ +listener+ t }
} define-operation