#![ allow( unused_imports ) ]
use test_tools::*;
use core::mem::size_of;
use num_traits::cast::cast;
use math_adapter::prelude::*;
use math_adapter::X2;
use crate::{ num };
tests_impls!
{
fn basic()
{
type T = i8;
{
a_id!( size_of::< cgmath::Vector2::< T > >(), size_of::< ( T, T ) >() );
a_id!( size_of::< cgmath::Vector2::< T > >(), size_of::< [ T ; 2 ] >() );
a_id!( size_of::< cgmath::Vector2::< T > >(), 2 );
}
{
let got = cgmath::Vector2::< T >{ x : 1, y : 2 };
a_id!( got.x, 1 );
a_id!( got.y, 2 );
a_id!( got._0(), 1 );
a_id!( got._1(), 2 );
}
{
let got = math_adapter::cgmath::Vector2::< T >::make( 1, 2 );
let exp = cgmath::Vector2::< T >{ x : 1, y : 2 };
a_id!( got, exp );
}
}
fn canonical()
{
math_adapter::for_each!
(
crate::macro_foreign_x2::macro_test_foreign_x2_number_for_each,
{ cgmath::Vector2, x, y },
{ cgmath::Point2, x, y },
);
}
fn convertion_as_specific()
{
type T = i8;
crate::macro_foreign_x2::macro_test_foreign_x2_as_specific!( cgmath::Vector2, cgmath ; T );
}
}
tests_index!
{
basic,
canonical,
convertion_as_specific,
}