]> gitweb.factorcode.org Git - factor.git/commitdiff
Add unit test for regression
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 23 Mar 2009 02:42:15 +0000 (21:42 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 23 Mar 2009 02:42:15 +0000 (21:42 -0500)
basis/compiler/tests/redefine15.factor [new file with mode: 0644]

diff --git a/basis/compiler/tests/redefine15.factor b/basis/compiler/tests/redefine15.factor
new file mode 100644 (file)
index 0000000..797460a
--- /dev/null
@@ -0,0 +1,20 @@
+USING: compiler.units words tools.test math kernel ;
+IN: compiler.tests.redefine15
+
+DEFER: word-1
+
+: word-2 ( a -- b ) word-1 ;
+
+[ \ word-1 [ ] (( a -- b )) define-declared ] with-compilation-unit 
+
+[ "a" ] [ "a" word-2 ] unit-test
+
+: word-3 ( a -- b ) 1 + ;
+
+: word-4 ( a -- b c ) 0 swap word-3 swap 1+ ;
+
+[ 1 1 ] [ 0 word-4 ] unit-test
+
+[ \ word-3 [ [ 2 + ] bi@ ] (( a b -- c d )) define-declared ] with-compilation-unit
+
+[ 2 3 ] [ 0 word-4 ] unit-test
\ No newline at end of file