Skip to content

Commit d12a136

Browse files
committed
std: Fix float tests
1 parent c365252 commit d12a136

File tree

4 files changed

+19
-48
lines changed

4 files changed

+19
-48
lines changed

src/libcore/fmt/mod.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,32 +43,6 @@ mod num;
4343
mod float;
4444
pub mod rt;
4545

46-
#[cfg(stage0)]
47-
#[allow(missing_doc)]
48-
pub mod parse {
49-
#[deriving(Eq)]
50-
pub enum Alignment {
51-
AlignLeft,
52-
AlignRight,
53-
AlignUnknown,
54-
}
55-
56-
pub enum PluralKeyword {
57-
Zero,
58-
One,
59-
Two,
60-
Few,
61-
Many,
62-
}
63-
64-
pub enum Flag {
65-
FlagSignPlus,
66-
FlagSignMinus,
67-
FlagAlternate,
68-
FlagSignAwareZeroPad,
69-
}
70-
}
71-
7246
pub type Result = result::Result<(), FormatError>;
7347

7448
/// dox
@@ -98,7 +72,7 @@ pub struct Formatter<'a> {
9872
/// Optionally specified precision for numeric types
9973
pub precision: Option<uint>,
10074

101-
/// dox
75+
#[allow(missing_doc)]
10276
#[cfg(stage0)]
10377
pub buf: &'a mut FormatWriter,
10478
#[cfg(not(stage0))]

src/libstd/fmt.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,6 @@ use str::{StrAllocating};
492492
use str;
493493
use slice::Vector;
494494

495-
#[cfg(stage0)]
496-
pub use core::fmt::parse;
497-
498495
pub use core::fmt::{Formatter, Result, FormatWriter, Show, rt};
499496
pub use core::fmt::{Show, Bool, Char, Signed, Unsigned, Octal, Binary};
500497
pub use core::fmt::{LowerHex, UpperHex, String, Pointer};

src/libstd/num/f32.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -734,18 +734,18 @@ mod tests {
734734
// are supported in floating-point literals
735735
let f1: f32 = from_str_hex("1p-123").unwrap();
736736
let f2: f32 = from_str_hex("1p-111").unwrap();
737-
assert_eq!(Float::ldexp(1f32, -123), f1);
738-
assert_eq!(Float::ldexp(1f32, -111), f2);
737+
assert_eq!(FloatMath::ldexp(1f32, -123), f1);
738+
assert_eq!(FloatMath::ldexp(1f32, -111), f2);
739739

740-
assert_eq!(Float::ldexp(0f32, -123), 0f32);
741-
assert_eq!(Float::ldexp(-0f32, -123), -0f32);
740+
assert_eq!(FloatMath::ldexp(0f32, -123), 0f32);
741+
assert_eq!(FloatMath::ldexp(-0f32, -123), -0f32);
742742

743743
let inf: f32 = Float::infinity();
744744
let neg_inf: f32 = Float::neg_infinity();
745745
let nan: f32 = Float::nan();
746-
assert_eq!(Float::ldexp(inf, -123), inf);
747-
assert_eq!(Float::ldexp(neg_inf, -123), neg_inf);
748-
assert!(Float::ldexp(nan, -123).is_nan());
746+
assert_eq!(FloatMath::ldexp(inf, -123), inf);
747+
assert_eq!(FloatMath::ldexp(neg_inf, -123), neg_inf);
748+
assert!(FloatMath::ldexp(nan, -123).is_nan());
749749
}
750750

751751
#[test]
@@ -758,8 +758,8 @@ mod tests {
758758
let (x2, exp2) = f2.frexp();
759759
assert_eq!((x1, exp1), (0.5f32, -122));
760760
assert_eq!((x2, exp2), (0.5f32, -110));
761-
assert_eq!(Float::ldexp(x1, exp1), f1);
762-
assert_eq!(Float::ldexp(x2, exp2), f2);
761+
assert_eq!(FloatMath::ldexp(x1, exp1), f1);
762+
assert_eq!(FloatMath::ldexp(x2, exp2), f2);
763763

764764
assert_eq!(0f32.frexp(), (0f32, 0));
765765
assert_eq!((-0f32).frexp(), (-0f32, 0));

src/libstd/num/f64.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -734,18 +734,18 @@ mod tests {
734734
// are supported in floating-point literals
735735
let f1: f64 = from_str_hex("1p-123").unwrap();
736736
let f2: f64 = from_str_hex("1p-111").unwrap();
737-
assert_eq!(Float::ldexp(1f64, -123), f1);
738-
assert_eq!(Float::ldexp(1f64, -111), f2);
737+
assert_eq!(FloatMath::ldexp(1f64, -123), f1);
738+
assert_eq!(FloatMath::ldexp(1f64, -111), f2);
739739

740-
assert_eq!(Float::ldexp(0f64, -123), 0f64);
741-
assert_eq!(Float::ldexp(-0f64, -123), -0f64);
740+
assert_eq!(FloatMath::ldexp(0f64, -123), 0f64);
741+
assert_eq!(FloatMath::ldexp(-0f64, -123), -0f64);
742742

743743
let inf: f64 = Float::infinity();
744744
let neg_inf: f64 = Float::neg_infinity();
745745
let nan: f64 = Float::nan();
746-
assert_eq!(Float::ldexp(inf, -123), inf);
747-
assert_eq!(Float::ldexp(neg_inf, -123), neg_inf);
748-
assert!(Float::ldexp(nan, -123).is_nan());
746+
assert_eq!(FloatMath::ldexp(inf, -123), inf);
747+
assert_eq!(FloatMath::ldexp(neg_inf, -123), neg_inf);
748+
assert!(FloatMath::ldexp(nan, -123).is_nan());
749749
}
750750

751751
#[test]
@@ -758,8 +758,8 @@ mod tests {
758758
let (x2, exp2) = f2.frexp();
759759
assert_eq!((x1, exp1), (0.5f64, -122));
760760
assert_eq!((x2, exp2), (0.5f64, -110));
761-
assert_eq!(Float::ldexp(x1, exp1), f1);
762-
assert_eq!(Float::ldexp(x2, exp2), f2);
761+
assert_eq!(FloatMath::ldexp(x1, exp1), f1);
762+
assert_eq!(FloatMath::ldexp(x2, exp2), f2);
763763

764764
assert_eq!(0f64.frexp(), (0f64, 0));
765765
assert_eq!((-0f64).frexp(), (-0f64, 0));

0 commit comments

Comments
 (0)