]> gitweb.factorcode.org Git - factor.git/commitdiff
Unit test fixes, and use infer. in UI
authorslava <slava@factorcode.org>
Mon, 13 Nov 2006 03:40:25 +0000 (03:40 +0000)
committerslava <slava@factorcode.org>
Mon, 13 Nov 2006 03:40:25 +0000 (03:40 +0000)
library/compiler/test/callbacks.factor
library/test/redefine.factor
library/ui/tools/operations.factor

index 5b8e7d1ffeb1fb0deabeeb5eb6347822de7ec252..280f20410871658bf9303b1e50b9f1b8a0062b10 100644 (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
 
index 039ee30723cef78a2bf35ca8a334e1feec5770d5..225dd816abfa23064350ece591403bad0bc6bc5c 100644 (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
index 3f16a1047cad5f5a9e762e65a46d5220bf6be2be..cef6c0531004a956b41a912e6b5e7966cb1959d5 100644 (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