Add path for time::epoch constant (#4773)
This commit is contained in:
parent
be24734048
commit
065ac9cd5a
2 changed files with 10 additions and 0 deletions
|
@ -458,6 +458,7 @@ pub(crate) static PATHS: phf::Map<UniCase<&'static str>, PathKind> = phf_map! {
|
|||
UniCase::ascii("math::PI") => PathKind::Constant(Constant::MathPi),
|
||||
UniCase::ascii("math::SQRT_2") => PathKind::Constant(Constant::MathSqrt2),
|
||||
UniCase::ascii("math::TAU") => PathKind::Constant(Constant::MathTau),
|
||||
UniCase::ascii("time::EPOCH") => PathKind::Constant(Constant::TimeEpoch)
|
||||
};
|
||||
|
||||
impl Parser<'_> {
|
||||
|
|
|
@ -144,6 +144,9 @@ fn constant_lowercase() {
|
|||
|
||||
let out = test_parse!(parse_value_table, r#" math::neg_inf "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::MathNegInf));
|
||||
|
||||
let out = test_parse!(parse_value_table, r#" time::epoch "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::TimeEpoch));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -156,6 +159,9 @@ fn constant_uppercase() {
|
|||
|
||||
let out = test_parse!(parse_value_table, r#" MATH::NEG_INF "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::MathNegInf));
|
||||
|
||||
let out = test_parse!(parse_value_table, r#" TIME::EPOCH "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::TimeEpoch));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -168,6 +174,9 @@ fn constant_mixedcase() {
|
|||
|
||||
let out = test_parse!(parse_value_table, r#" MaTh::Neg_Inf "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::MathNegInf));
|
||||
|
||||
let out = test_parse!(parse_value_table, r#" TiME::ePoCH "#).unwrap();
|
||||
assert_eq!(out, Value::Constant(Constant::TimeEpoch));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue