]> gitweb.factorcode.org Git - factor.git/commitdiff
Adding tests for advice
authorJames Cash <james.nvc@gmail.com>
Thu, 6 Nov 2008 04:49:57 +0000 (23:49 -0500)
committerJames Cash <james.nvc@gmail.com>
Thu, 6 Nov 2008 05:20:52 +0000 (00:20 -0500)
extra/advice/advice-tests.factor

index 0d71ef2220d31249e6d5de5beeae17266c05e444..868f81cbe8c41ac349d7cca3899608c7e0591ab7 100644 (file)
@@ -1,5 +1,22 @@
 ! Copyright (C) 2008 James Cash
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel sequences tools.tests advice ;
+USING: kernel sequences tools.test advice parser ;
 IN: advice.tests
 
+[
+: foo "foo" ; 
+\ foo make-advised
+ { "bar" "foo" } [
+     [ "bar" ] "barify" \ foo advise-before
+     foo ] unit-test
+ { "bar" "foo" "baz" } [
+      [ "baz" ] "bazify" \ foo advise-after
+      foo ] unit-test
+ { "foo" "baz" } [
+     "barify" \ foo before remove-advice
+     foo ] unit-test
+ ] with-interactive-vocabs
\ No newline at end of file