]> gitweb.factorcode.org Git - factor.git/blob - basis/struct-vectors/struct-vectors-tests.factor
change math.floats.env tests not to use any libm functions, which don't reliably...
[factor.git] / basis / struct-vectors / struct-vectors-tests.factor
1 IN: struct-vectors.tests
2 USING: struct-vectors tools.test alien.c-types classes.struct accessors
3 namespaces kernel sequences ;
4
5 STRUCT: point { x float } { y float } ;
6
7 : make-point ( x y -- point ) point <struct-boa> ;
8
9 [ ] [ 1 point <struct-vector> "v" set ] unit-test
10
11 [ 1.5 6.0 ] [
12     1.0 2.0 make-point "v" get push
13     3.0 4.5 make-point "v" get push
14     1.5 6.0 make-point "v" get push
15     "v" get pop [ x>> ] [ y>> ] bi
16 ] unit-test