factor/core/test/redefine.factor

32 lines
1.3 KiB
Factor
Raw Normal View History

USING: compiler definitions generic hashtables inference math
2006-11-12 22:40:25 -05:00
namespaces parser test words kernel sequences arrays ;
IN: temporary
2005-03-26 20:40:29 -05:00
DEFER: foo \ foo reset-generic
DEFER: bar \ bar reset-generic
2005-03-26 20:40:29 -05:00
2006-11-12 22:40:25 -05:00
: short-effect
dup effect-in length swap effect-out length 2array nip ;
[ ] [ \ foo [ 1 2 ] define-compound ] unit-test
2006-11-12 22:40:25 -05:00
[ { 0 2 } ] [ [ foo ] infer short-effect ] unit-test
[ ] [ \ foo compile ] unit-test
[ ] [ \ bar [ foo foo ] define-compound ] unit-test
[ ] [ \ bar compile ] unit-test
[ ] [ \ foo [ 1 2 3 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ recompile ] unit-test
2006-11-12 22:40:25 -05:00
[ { 0 3 } ] [ [ foo ] infer short-effect ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ bar [ 1 2 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ recompile ] unit-test
2006-11-12 22:40:25 -05:00
[ { 0 2 } ] [ [ bar ] infer short-effect ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ foo [ 1 2 3 ] define-compound ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ bar [ 1 2 3 ] define-compound ] unit-test
[ t ] [ \ bar changed-words get hash-member? ] unit-test
[ ] [ \ bar forget ] unit-test
[ f ] [ \ bar changed-words get hash-member? ] unit-test