factor/basis/macros/macros-tests.factor

24 lines
710 B
Factor
Raw Normal View History

2008-03-01 17:00:45 -05:00
IN: macros.tests
2007-09-20 18:09:08 -04:00
USING: tools.test macros math kernel arrays
vectors io.streams.string prettyprint parser eval see ;
2007-09-20 18:09:08 -04:00
2009-03-23 01:34:02 -04:00
MACRO: see-test ( a b -- quot ) + ;
2008-05-28 19:17:58 -04:00
2009-03-23 01:34:02 -04:00
[ t ] [ \ see-test macro? ] unit-test
[ "USING: macros math ;\nIN: macros.tests\nMACRO: see-test ( a b -- quot ) + ;\n" ]
2008-05-28 19:17:58 -04:00
[ [ \ see-test see ] with-string-writer ]
unit-test
2009-03-23 01:34:02 -04:00
[ t ] [ \ see-test macro? ] unit-test
2008-05-28 19:17:58 -04:00
[ t ] [
2009-04-17 13:46:04 -04:00
"USING: math ;\nIN: macros.tests\n: see-test ( a b -- c ) - ;\n" dup (( -- )) eval
2008-05-28 19:17:58 -04:00
[ \ see-test see ] with-string-writer =
] unit-test
2008-06-11 03:58:38 -04:00
2009-03-23 01:34:02 -04:00
[ f ] [ \ see-test macro? ] unit-test
2009-04-17 13:46:04 -04:00
[ ] [ "USING: macros stack-checker kernel ; IN: hanging-macro MACRO: c ( quot -- ) infer drop [ ] ; : a ( -- ) [ a ] c ;" (( -- )) eval ] unit-test
2008-06-11 03:58:38 -04:00