Test floats with leading dots in gnu_units

This commit is contained in:
Colin Benner 2018-10-01 12:03:48 +02:00
parent 30fcab3528
commit a5ccdaf1b9

View file

@ -610,4 +610,13 @@ mod tests {
"Expected term, got Error(\"Unexpected EOF\")"
);
}
#[test]
fn test_float_leading_dot() {
use gmp::mpq::Mpq;
use gmp::mpz::Mpz;
let num = Mpz::from(123);
let den = Mpz::from(1000);
expect!(".123", Expr::Const, Num::Mpq(Mpq::ratio(&num, &den)));
}
}