aboutsummaryrefslogtreecommitdiff
path: root/vendor/serde_json/tests/lexical/exponent.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/serde_json/tests/lexical/exponent.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/serde_json/tests/lexical/exponent.rs')
-rw-r--r--vendor/serde_json/tests/lexical/exponent.rs54
1 files changed, 0 insertions, 54 deletions
diff --git a/vendor/serde_json/tests/lexical/exponent.rs b/vendor/serde_json/tests/lexical/exponent.rs
deleted file mode 100644
index f7a847b..0000000
--- a/vendor/serde_json/tests/lexical/exponent.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-// Adapted from https://github.com/Alexhuszagh/rust-lexical.
-
-use crate::lexical::exponent::*;
-
-#[test]
-fn scientific_exponent_test() {
- // 0 digits in the integer
- assert_eq!(scientific_exponent(0, 0, 5), -6);
- assert_eq!(scientific_exponent(10, 0, 5), 4);
- assert_eq!(scientific_exponent(-10, 0, 5), -16);
-
- // >0 digits in the integer
- assert_eq!(scientific_exponent(0, 1, 5), 0);
- assert_eq!(scientific_exponent(0, 2, 5), 1);
- assert_eq!(scientific_exponent(0, 2, 20), 1);
- assert_eq!(scientific_exponent(10, 2, 20), 11);
- assert_eq!(scientific_exponent(-10, 2, 20), -9);
-
- // Underflow
- assert_eq!(
- scientific_exponent(i32::min_value(), 0, 0),
- i32::min_value()
- );
- assert_eq!(
- scientific_exponent(i32::min_value(), 0, 5),
- i32::min_value()
- );
-
- // Overflow
- assert_eq!(
- scientific_exponent(i32::max_value(), 0, 0),
- i32::max_value() - 1
- );
- assert_eq!(
- scientific_exponent(i32::max_value(), 5, 0),
- i32::max_value()
- );
-}
-
-#[test]
-fn mantissa_exponent_test() {
- assert_eq!(mantissa_exponent(10, 5, 0), 5);
- assert_eq!(mantissa_exponent(0, 5, 0), -5);
- assert_eq!(
- mantissa_exponent(i32::max_value(), 5, 0),
- i32::max_value() - 5
- );
- assert_eq!(mantissa_exponent(i32::max_value(), 0, 5), i32::max_value());
- assert_eq!(mantissa_exponent(i32::min_value(), 5, 0), i32::min_value());
- assert_eq!(
- mantissa_exponent(i32::min_value(), 0, 5),
- i32::min_value() + 5
- );
-}