Tests of around-advice
parent
894d9a67c9
commit
6035bb3130
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2008 James Cash
|
! Copyright (C) 2008 James Cash
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel sequences tools.test advice parser ;
|
USING: kernel sequences math tools.test advice parser namespaces ;
|
||||||
IN: advice.tests
|
IN: advice.tests
|
||||||
|
|
||||||
[
|
[
|
||||||
|
@ -19,4 +19,22 @@ IN: advice.tests
|
||||||
"barify" \ foo before remove-advice
|
"barify" \ foo before remove-advice
|
||||||
foo ] unit-test
|
foo ] unit-test
|
||||||
|
|
||||||
] with-interactive-vocabs
|
: bar ( a -- b ) 1+ ;
|
||||||
|
\ bar make-advised
|
||||||
|
|
||||||
|
{ 11 } [
|
||||||
|
[ 2 * ] "double" \ bar advise-before
|
||||||
|
5 bar
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
{ 11/3 } [
|
||||||
|
[ 3 / ] "third" \ bar advise-after
|
||||||
|
5 bar
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
{ -2 } [
|
||||||
|
[ -1 * ad-do-it 3 + ] "frobnobicate" \ bar advise-around
|
||||||
|
5 bar
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
] with-scope
|
Loading…
Reference in New Issue