add more hex literal parsing test cases

This commit is contained in:
Kaspar Schleiser 2023-05-27 16:50:52 +02:00 committed by ISibboI
parent 40d27df446
commit 6211888086

View File

@ -2296,4 +2296,9 @@ fn test_builtin_functions_context() {
fn test_hex() { fn test_hex() {
assert_eq!(eval("0x3"), Ok(Value::Int(3))); assert_eq!(eval("0x3"), Ok(Value::Int(3)));
assert_eq!(eval("0xFF"), Ok(Value::Int(255))); assert_eq!(eval("0xFF"), Ok(Value::Int(255)));
assert_eq!(eval("-0xFF"), Ok(Value::Int(-255)));
assert_eq!(
eval("0x"),
Err(EvalexprError::VariableIdentifierNotFound("0x".into()))
);
} }