]> gitweb.factorcode.org Git - factor.git/blob - basis/macros/macros-tests.factor
Create basis vocab root
[factor.git] / basis / macros / macros-tests.factor
1 IN: macros.tests
2 USING: tools.test macros math kernel arrays
3 vectors io.streams.string prettyprint parser ;
4
5 MACRO: see-test ( a b -- c ) + ;
6
7 [ "USING: macros math ;\nIN: macros.tests\nMACRO: see-test ( a b -- c ) + ;\n" ]
8 [ [ \ see-test see ] with-string-writer ]
9 unit-test
10
11 [ t ] [
12     "USING: math ;\nIN: macros.tests\n: see-test ( a b -- c ) - ;\n" dup eval
13     [ \ see-test see ] with-string-writer =
14 ] unit-test
15
16 [ ] [ "USING: macros inference kernel ; IN: hanging-macro MACRO: c ( quot -- ) infer drop [ ] ; : a ( -- ) [ a ] c ;" eval ] unit-test
17