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