Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Ignore failing test on PowerPC 64-bit #83

Merged
merged 3 commits into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions compact_str/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,22 +419,26 @@ fn test_to_compact_str() {
assert_int_MAX_to_compact_str!(isize);

// Test specialisation for f32 and f64 using ryu
Copy link
Contributor

@NobodyXu NobodyXu Apr 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we just need to add cfg here to include all assert_eq for testing specialisation for f32 and f64 using ryu:

Suggested change
// Test specialisation for f32 and f64 using ryu
// Test specialisation for f32 and f64 using ryu
#[cfg(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()
)
);
// 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());
Expand Down