use test_tools::*;
use math_adapter::prelude::*;
use math_adapter::X2;
tests_impls!
{
fn convertion_foreign()
{
type T = i8;
crate::macro_foreign_x2::macro_test_foreign_x2_as_foreign!( nalgebra::Vector2 ; T );
}
fn operation_deref()
{
type T = i8;
crate::macro_foreign_x2::macro_test_foreign_x2_operation_deref!( nalgebra::Vector2 ; T );
}
fn inter_cgmath()
{
#[ cfg( feature = "cgmath" ) ]
{
type T = i8;
{
let src1 = cgmath::Vector2::< T >::make( 1, 2 );
let src2 = nalgebra::Vector2::< T >::make( 3, 4 );
let got = src1.as_nalgebra() + src2;
let exp = nalgebra::Vector2::< T >::make( 4, 6 );
a_id!( got, exp );
}
{
let src = X2::< T >::make( 1, 2 );
let got = src.as_cgmath().sum();
a_id!( got, 3 );
let got = src.as_nalgebra().sum();
a_id!( got, 3 );
}
}
}
}
tests_index!
{
convertion_foreign,
operation_deref,
inter_cgmath,
}