use super::*;
tests_impls!
{
#[ test ]
fn basic()
{
{
a_id!( TheModule::number::parse::< f32, _ >( "1.0" ), Ok( 1.0 ) );
}
{
a_id!( TheModule::number::parse_partial::< i32, _ >( "1a" ), Ok( ( 1, 1 ) ) );
}
{
const FORMAT : u128 = TheModule::number::format::STANDARD;
let options = TheModule::number::ParseFloatOptions::builder()
.exponent( b'^' )
.decimal_point( b',' )
.build()
.unwrap();
let got = TheModule::number::parse_partial_with_options::< f32, _, FORMAT >( "0", &options );
let exp = Ok( ( 0.0, 1 ) );
a_id!( got, exp );
}
{
const FORMAT: u128 = TheModule::number::format::STANDARD;
let options = TheModule::number::ParseFloatOptions::builder()
.exponent( b'^' )
.decimal_point( b',' )
.build()
.unwrap();
let got = TheModule::number::parse_with_options::< f32, _, FORMAT >( "1,2345", &options );
let exp = Ok( 1.2345 );
a_id!( got, exp );
}
{
a_id!( TheModule::number::to_string( 5 ), "5" );
}
}
}
tests_index!
{
basic,
}