Merge branch 'v1.3-fixes'
This commit is contained in:
@@ -162,6 +162,13 @@ fn test_blobs_parse() -> Result<(), Box<EvalAltResult>> {
|
||||
0x1cf588
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
engine.eval::<Blob>(
|
||||
"let x = blob(16, 0); write_be(x, 0, 8, 0x1234567890abcdef); write_be(x, 8, 8, 0xabcdef1234567890); x"
|
||||
)?,
|
||||
vec![0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef, 0xab, 0xcd, 0xef, 0x12, 0x34, 0x56, 0x78, 0x90]
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,11 @@ fn test_hex_literal() -> Result<(), Box<EvalAltResult>> {
|
||||
assert_eq!(engine.eval::<INT>("let x = 0Xf; x")?, 15);
|
||||
assert_eq!(engine.eval::<INT>("let x = 0xff; x")?, 255);
|
||||
|
||||
#[cfg(not(feature = "only_i32"))]
|
||||
assert_eq!(engine.eval::<INT>("let x = 0xffffffffffffffff; x")?, -1);
|
||||
#[cfg(feature = "only_i32")]
|
||||
assert_eq!(engine.eval::<INT>("let x = 0xffffffff; x")?, -1);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -51,6 +56,18 @@ fn test_binary_literal() -> Result<(), Box<EvalAltResult>> {
|
||||
engine.eval::<INT>("let x = 0b0011_1100_1010_0101; x")?,
|
||||
15525
|
||||
);
|
||||
#[cfg(not(feature = "only_i32"))]
|
||||
assert_eq!(
|
||||
engine.eval::<INT>(
|
||||
"let x = 0b11111111_11111111_11111111_11111111_11111111_11111111_11111111_11111111; x"
|
||||
)?,
|
||||
-1
|
||||
);
|
||||
#[cfg(feature = "only_i32")]
|
||||
assert_eq!(
|
||||
engine.eval::<INT>("let x = 0b11111111_11111111_11111111_11111111; x")?,
|
||||
-1
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user