summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2020-11-04 21:22:24 +0000
committerAlex Orlenko <zxteam@protonmail.com>2020-11-04 21:22:24 +0000
commit661f8e592afc75ef5ea808a1277eca03a2a15a94 (patch)
tree5a97620aaefcf3051a177ba189b20405a3ab8117
parentc8a7aa947c5fe73bc271f4b938842238ae48d200 (diff)
downloadmlua-661f8e592afc75ef5ea808a1277eca03a2a15a94.zip
Update num-traits dependency
Fix f32-to-f64 conversion tests
-rw-r--r--Cargo.toml2
-rw-r--r--tests/tests.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 059e1c9..d3d00b5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -44,7 +44,7 @@ send = []
[dependencies]
bstr = { version = "0.2", features = ["std"], default_features = false }
lazy_static = { version = "1.4" }
-num-traits = { version = "0.2.11" }
+num-traits = { version = "0.2.14" }
futures-core = { version = "0.3.5", optional = true }
futures-task = { version = "0.3.5", optional = true }
futures-util = { version = "0.3.5", optional = true }
diff --git a/tests/tests.rs b/tests/tests.rs
index 61eefa3..da8b739 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -509,7 +509,9 @@ fn test_num_conversion() -> Result<()> {
assert!(lua.load("math.huge").eval::<i64>().is_err());
assert_eq!(lua.unpack::<f64>(lua.pack(f32::MAX)?)?, f32::MAX as f64);
- assert!(lua.unpack::<f32>(lua.pack(f64::MAX)?).is_err());
+ assert_eq!(lua.unpack::<f64>(lua.pack(f32::MIN)?)?, f32::MIN as f64);
+ assert_eq!(lua.unpack::<f32>(lua.pack(f64::MAX)?)?, f32::INFINITY);
+ assert_eq!(lua.unpack::<f32>(lua.pack(f64::MIN)?)?, f32::NEG_INFINITY);
assert_eq!(lua.unpack::<i128>(lua.pack(1i128 << 64)?)?, 1i128 << 64);