]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/complex/complex-tests.factor
factor: Retrying on the unit tests. Also normalize some syntax with FUNCTION:.
[factor.git] / basis / alien / complex / complex-tests.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors tools.test alien.complex classes.struct kernel
4 alien.c-types alien.syntax namespaces math ;
5 IN: alien.complex.tests
6
7 STRUCT: complex-holder
8     { z complex-float } ;
9
10 : <complex-holder> ( z -- alien )
11     complex-holder <struct-boa> ;
12
13 { } [
14     C{ 1.0 2.0 } <complex-holder> "h" set
15 ] unit-test
16
17 { C{ 1.0 2.0 } } [ "h" get z>> ] unit-test
18
19 { complex } [ complex-float c-type-boxed-class ] unit-test
20
21 { complex } [ complex-double c-type-boxed-class ] unit-test