From 6d11b52fe32e990eef49af057f5c575a467871ce Mon Sep 17 00:00:00 2001 From: Parker Timmerman Date: Tue, 26 Apr 2022 10:09:28 -0400 Subject: [PATCH 1/3] branch start --- compact_str/src/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compact_str/src/tests.rs b/compact_str/src/tests.rs index 2fea9611..fb3bddde 100644 --- a/compact_str/src/tests.rs +++ b/compact_str/src/tests.rs @@ -419,6 +419,8 @@ fn test_to_compact_str() { assert_int_MAX_to_compact_str!(isize); // Test specialisation for f32 and f64 using ryu + // TODO: Fix bug in powerpc64, which is a little endian system + #[cfg(not(all(target_arch = "powerpc64", target_pointer_width = "64")))] assert_eq!( (&*3.2_f32.to_string(), &*288888.290028_f64.to_string()), ( From 316e88dccf385db8ac9c5583aa1c0daeaebfd49c Mon Sep 17 00:00:00 2001 From: Parker Timmerman Date: Tue, 26 Apr 2022 11:05:14 -0400 Subject: [PATCH 2/3] ignore entire test --- compact_str/src/tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compact_str/src/tests.rs b/compact_str/src/tests.rs index fb3bddde..ed601e78 100644 --- a/compact_str/src/tests.rs +++ b/compact_str/src/tests.rs @@ -390,6 +390,8 @@ macro_rules! assert_int_MAX_to_compact_str { } #[test] +// TODO: Fix bug in powerpc64, which is a little endian system +#[cfg_attr(not(all(target_arch = "powerpc64", target_pointer_width = "64")), ignore)] fn test_to_compact_str() { // Test specialisation for bool, char and String assert_eq!(&*true.to_string(), "true".to_compact_str()); @@ -419,8 +421,6 @@ fn test_to_compact_str() { assert_int_MAX_to_compact_str!(isize); // Test specialisation for f32 and f64 using ryu - // TODO: Fix bug in powerpc64, which is a little endian system - #[cfg(not(all(target_arch = "powerpc64", target_pointer_width = "64")))] assert_eq!( (&*3.2_f32.to_string(), &*288888.290028_f64.to_string()), ( From fb3eb495e5b708d9fd4b20444510fdcc3b54f0c1 Mon Sep 17 00:00:00 2001 From: Parker Timmerman Date: Tue, 26 Apr 2022 11:46:19 -0400 Subject: [PATCH 3/3] conditionally compile out the float block since we want to run other ignored tests --- compact_str/src/tests.rs | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/compact_str/src/tests.rs b/compact_str/src/tests.rs index ed601e78..0a6ddd0a 100644 --- a/compact_str/src/tests.rs +++ b/compact_str/src/tests.rs @@ -390,8 +390,6 @@ macro_rules! assert_int_MAX_to_compact_str { } #[test] -// TODO: Fix bug in powerpc64, which is a little endian system -#[cfg_attr(not(all(target_arch = "powerpc64", target_pointer_width = "64")), ignore)] fn test_to_compact_str() { // Test specialisation for bool, char and String assert_eq!(&*true.to_string(), "true".to_compact_str()); @@ -421,22 +419,26 @@ fn test_to_compact_str() { assert_int_MAX_to_compact_str!(isize); // Test specialisation for f32 and f64 using ryu - assert_eq!( - (&*3.2_f32.to_string(), &*288888.290028_f64.to_string()), - ( - &*3.2_f32.to_compact_str(), - &*288888.290028_f64.to_compact_str() - ) - ); + // TODO: Fix bug in powerpc64, which is a little endian system + #[cfg(not(all(target_arch = "powerpc64", target_pointer_width = "64")))] + { + assert_eq!( + (&*3.2_f32.to_string(), &*288888.290028_f64.to_string()), + ( + &*3.2_f32.to_compact_str(), + &*288888.290028_f64.to_compact_str() + ) + ); - assert_eq!("inf", f32::INFINITY.to_compact_str()); - assert_eq!("-inf", f32::NEG_INFINITY.to_compact_str()); + assert_eq!("inf", f32::INFINITY.to_compact_str()); + assert_eq!("-inf", f32::NEG_INFINITY.to_compact_str()); - assert_eq!("inf", f64::INFINITY.to_compact_str()); - assert_eq!("-inf", f64::NEG_INFINITY.to_compact_str()); + assert_eq!("inf", f64::INFINITY.to_compact_str()); + assert_eq!("-inf", f64::NEG_INFINITY.to_compact_str()); - assert_eq!("NaN", f32::NAN.to_compact_str()); - assert_eq!("NaN", f64::NAN.to_compact_str()); + assert_eq!("NaN", f32::NAN.to_compact_str()); + assert_eq!("NaN", f64::NAN.to_compact_str()); + } // Test generic Display implementation assert_eq!("234", "234".to_compact_str());