]> gitweb.factorcode.org Git - factor.git/blob - extra/multi-methods/tests/definitions.factor
4b34513017d56fc27a6430dd18eb9f8d3d45b555
[factor.git] / extra / multi-methods / tests / definitions.factor
1 USING: multi-methods tools.test math sequences namespaces system
2 kernel strings words compiler.units quotations ;
3 IN: multi-methods.tests
4
5 DEFER: fake
6 \ fake H{ } clone "multi-methods" set-word-prop
7 << ( -- ) \ fake set-stack-effect >>
8
9 [
10     [ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test
11
12     [ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ]
13     [ { } \ fake method-word-props ] unit-test
14
15     [ t ] [ { } \ fake <method> method-body? ] unit-test
16
17     [ { } [ ] ] [ \ fake methods prepare-methods [ sort-methods ] dip ] unit-test
18
19     [ t ] [ { } \ fake multi-dispatch-quot callable? ] unit-test
20
21     [ t ] [ \ fake make-generic quotation? ] unit-test
22
23     [ ] [ \ fake update-generic ] unit-test
24
25     DEFER: testing
26
27     [ ] [ \ testing ( -- ) define-generic ] unit-test
28
29     [ t ] [ \ testing generic? ] unit-test
30 ] with-compilation-unit