Skip to content

Commit 841bd33

Browse files
committed
Fix LuaJIT negative zero tests
1 parent 815d1bd commit 841bd33

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/conversion.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,12 @@ fn test_float_from_lua() -> Result<()> {
375375
// Negative zero
376376
let negative_zero = lua.load("return -0.0").eval::<f64>()?;
377377
assert_eq!(negative_zero, 0.0);
378+
// LuaJIT treats -0.0 as a positive zero
379+
#[cfg(not(feature = "luajit"))]
378380
assert!(negative_zero.is_sign_negative());
379381

380382
// In Lua <5.3 all numbers are floats
381-
#[cfg(not(any(feature = "lua54", feature = "lua53")))]
383+
#[cfg(not(any(feature = "lua54", feature = "lua53", feature = "luajit")))]
382384
{
383385
let negative_zero = lua.load("return -0").eval::<f64>()?;
384386
assert_eq!(negative_zero, 0.0);

0 commit comments

Comments
 (0)