about summary refs log tree commit diff
path: root/src/libcoretest/fmt
AgeCommit message (Collapse)AuthorLines
2017-04-03Move libXtest into libX/testsStjepan Glavina-727/+0
This change moves: 1. `libcoretest` into `libcore/tests` 2. `libcollectionstest` into `libcollections/tests` This is a follow-up to #39561.
2017-02-07Improve fmt floatSon-7/+25
* Move to a separate float mod * Add more tests for f64 f32 lower exp upper exp * Use assert_eq for a clearer error message
2017-02-01Adjust heuristics to better handle "{}..." format strings.Michał Krasnoborski-1/+3
2017-01-28use `String::with_capacity` in `format!`Michał Krasnoborski-0/+8
2016-03-12std: Clean out deprecated APIsAlex Crichton-104/+0
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-11cleanup int suffixes in libcoretestsrinivasreddy-10/+10
2016-02-08Implement fmt::Pointer for pointers to unsized typesKamal Marhubi-0/+8
This allows printing pointers to unsized types with the {:p} formatting directive. The following impls are extended to unsized types: - impl<'a, T: ?Sized> Pointer for &'a T - impl<'a, T: ?Sized> Pointer for &'a mut T - impl<T: ?Sized> Pointer for *const T - impl<T: ?Sized> Pointer for *mut T - impl<T: ?Sized> fmt::Pointer for Box<T> - impl<T: ?Sized> fmt::Pointer for Rc<T> - impl<T: ?Sized> fmt::Pointer for Arc<T>
2016-01-30test: Deny warnings in {core,collections}testAlex Crichton-1/+6
Help cleans up our build a bit and stays in line with the rest of our crates denying warnings traditionally.
2015-10-16Add unused modules to libcoretestFlorian Hahn-2/+5
2015-07-14Fix negate_unsigned feature gate checkSimonas Kazlauskas-2/+0
This commit fixes the negate_unsigned feature gate to appropriately account for infered variables. This is technically a [breaking-change].
2015-06-30std: Fix formatting flags for charsAlex Crichton-0/+2
This recently regressed in #24689, and this updates the `Display` implementation to take formatting flags into account. Closes #26625
2015-04-14test: Fixup many library unit testsAlex Crichton-14/+14
2015-04-10Fix for #23150Ben Ashford-0/+17
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-8/+8
Conflicts: src/libcore/num/mod.rs
2015-03-28Update debug helpers and add list builderSteven Fackler-30/+127
The collections debug helpers no longer prefix output with the collection name, in line with the current conventions for Debug implementations. Implementations that want to preserve the current behavior can simply add a `try!(write!(fmt, "TypeName "));` at the beginning of the `fmt` method. [breaking-change]
2015-03-09Switch derive(Debug) to use the debug buildersSteven Fackler-0/+10
2015-03-09Implement RFC 640Steven Fackler-0/+392
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-1/+1
2015-02-20try to reduce bajillion warningsAlexis-14/+14
2015-02-18Convert required suffixes into a use of `as`.Niko Matsakis-13/+13
2015-01-26std: Rename Writer::write to Writer::write_allAlex Crichton-2/+2
In preparation for upcoming changes to the `Writer` trait (soon to be called `Write`) this commit renames the current `write` method to `write_all` to match the semantics of the upcoming `write_all` method. The `write` method will be repurposed to return a `usize` indicating how much data was written which differs from the current `write` semantics. In order to head off as much unintended breakage as possible, the method is being deprecated now in favor of a new name. [breaking-change]
2015-01-23Clean up `isize`, `usize`. Don't bench allocation but formatting.Tobias Bucher-70/+72
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-12/+12
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-0/+24
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2014-12-06libcoretest: remove unnecessary `as_slice()` callsJorge Aparicio-107/+107
2014-11-18std: Stabilize std::fmtAlex Crichton-44/+37
This commit applies the stabilization of std::fmt as outlined in [RFC 380][rfc]. There are a number of breaking changes as a part of this commit which will need to be handled to migrated old code: * A number of formatting traits have been removed: String, Bool, Char, Unsigned, Signed, and Float. It is recommended to instead use Show wherever possible or to use adaptor structs to implement other methods of formatting. * The format specifier for Boolean has changed from `t` to `b`. * The enum `FormatError` has been renamed to `Error` as well as becoming a unit struct instead of an enum. The `WriteError` variant no longer exists. * The `format_args_method!` macro has been removed with no replacement. Alter code to use the `format_args!` macro instead. * The public fields of a `Formatter` have become read-only with no replacement. Use a new formatting string to alter the formatting flags in combination with the `write!` macro. The fields can be accessed through accessor methods on the `Formatter` structure. Other than these breaking changes, the contents of std::fmt should now also all contain stability markers. Most of them are still #[unstable] or #[experimental] [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0380-stabilize-std-fmt.md [breaking-change] Closes #18904
2014-10-28Update code with new lint namesAaron Turon-1/+1
2014-09-09coretest: Ensure that pointer formatting flags are cleaned upPiotr Czarnecki-0/+7
2014-06-29Extract tests from libcore to a separate crateSteven Fackler-0/+245
Libcore's test infrastructure is complicated by the fact that many lang items are defined in the crate. The current approach (realcore/realstd imports) is hacky and hard to work with (tests inside of core::cmp haven't been run for months!). Moving tests to a separate crate does mean that they can only test the public API of libcore, but I don't feel that that is too much of an issue. The only tests that I had to get rid of were some checking the various numeric formatters, but those are also exercised through normal format! calls in other tests.