Test too big/small int literals

This commit is contained in:
Richard Feldman 2019-09-14 16:03:15 -05:00
parent dfd1d4bbb4
commit 5e740da48c
3 changed files with 22 additions and 5 deletions

View file

@ -111,12 +111,12 @@ where
match f64_buf.parse::<f64>() {
Ok(float) => Expr::Float(float),
Err(_) => Expr::MalformedNumber(Problem::TooLarge),
Err(_) => Expr::MalformedNumber(Problem::OutsideSupportedRange),
}
} else {
match before_decimal.parse::<i64>() {
Ok(int_val) => Expr::Int(int_val),
Err(_) => Expr::MalformedNumber(Problem::TooLarge),
Err(_) => Expr::MalformedNumber(Problem::OutsideSupportedRange),
}
};

View file

@ -21,5 +21,5 @@ pub enum Problem {
UnsupportedEscapedChar,
// NUMBER LITERAL
TooLarge,
OutsideSupportedRange,
}