From 6211888086b0e1a4158447a16a770d74cd83ac1a Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sat, 27 May 2023 16:50:52 +0200 Subject: [PATCH] add more hex literal parsing test cases --- tests/integration.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index ed9ff18..1fd07d3 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2296,4 +2296,9 @@ fn test_builtin_functions_context() { fn test_hex() { 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("0x"), + Err(EvalexprError::VariableIdentifierNotFound("0x".into())) + ); }