38 lines
1.0 KiB
Factor
38 lines
1.0 KiB
Factor
|
IN: multi-methods.tests
|
||
|
USING: multi-methods tools.test math sequences namespaces system
|
||
|
kernel strings words compiler.units quotations ;
|
||
|
|
||
|
\ GENERIC: must-infer
|
||
|
\ create-method-in must-infer
|
||
|
\ define-default-method must-infer
|
||
|
|
||
|
DEFER: fake
|
||
|
\ fake H{ } clone "multi-methods" set-word-prop
|
||
|
|
||
|
[ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test
|
||
|
|
||
|
[ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ]
|
||
|
[ { } \ fake method-word-props ] unit-test
|
||
|
|
||
|
[ t ] [ { } \ fake <method> method-body? ] unit-test
|
||
|
|
||
|
[
|
||
|
[ ] [ \ fake define-default-method ] unit-test
|
||
|
|
||
|
[ { } [ ] ] [ \ fake methods prepare-methods >r sort-methods r> ] unit-test
|
||
|
|
||
|
[ t ] [ { } \ fake multi-dispatch-quot quotation? ] unit-test
|
||
|
|
||
|
[ t ] [ \ fake make-generic quotation? ] unit-test
|
||
|
|
||
|
[ ] [ \ fake update-generic ] unit-test
|
||
|
|
||
|
DEFER: testing
|
||
|
|
||
|
[ ] [ \ testing define-generic ] unit-test
|
||
|
|
||
|
[ t ] [ \ testing generic? ] unit-test
|
||
|
|
||
|
[ t ] [ \ testing "default-multi-method" word-prop method-body? ] unit-test
|
||
|
] with-compilation-unit
|