summary refs log tree commit diff
path: root/src/libcore/tests
AgeCommit message (Collapse)AuthorLines
2017-09-24stabilized ord_max_min (fixes #25663)Michal Budzynski-1/+0
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-4/+0
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Auto merge of #43574 - notriddle:master, r=sfacklerbors-0/+18
Implement `RefCell::replace` and `RefCell::swap` Tracking issue: #43570
2017-08-12Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperiobors-1/+1
Fix some typos I wrote a really naive script and found those typos in the documentation.
2017-08-11Fix some typosBastien Orivel-1/+1
2017-08-02Fixed errors in libstd.Isaac van Bakel-6/+6
2017-07-31Implement `RefCell::replace` and `RefCell::swap`Michael Howell-0/+18
2017-07-26Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturonbors-1/+0
Stabilize more APIs for the 1.20.0 release In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
2017-07-26Rollup merge of #43471 - ollie27:try_from_ints, r=nagisaMark Simulacrum-4/+16
Add missing impl and tests for int to int TryFrom impls These were missing from #43248. r? @nagisa
2017-07-26Rollup merge of #42959 - SimonSapin:nonzero-checked, r=sfacklerMark Simulacrum-4/+4
Make the "main" constructors of NonZero/Shared/Unique return Option Per discussion in https://github.com/rust-lang/rust/issues/27730#issuecomment-303939441. This is a breaking change to unstable APIs. The old behavior is still available under the name `new_unchecked`. Note that only that one can be `const fn`, since `if` is currently not allowed in constant contexts. In the case of `NonZero` this requires adding a new `is_zero` method to the `Zeroable` trait. I mildly dislike this, but it’s not much worse than having a `Zeroable` trait in the first place. `Zeroable` and `NonZero` are both unstable, this can be reworked later.
2017-07-25std: Stabilize `char_escape_debug`Alex Crichton-1/+0
Stabilizes: * `<char>::escape_debug` * `std::char::EscapeDebug` Closes #35068
2017-07-25Add missing impl and tests for int to int TryFrom implsOliver Middleton-4/+16
2017-07-24improve the TryFrom implementationsAndre Bogus-0/+214
This removes the need for a 128 bit storage by making use of the fact that there can be either no over/underflow, either one or both, and each time the target type suffices to hold the limit for comparison. The downside is that the code looks a bit more complex. This test code included in this commit is from @oyvindln 's PR. They also greatly helped fixing a number of errors I made along the way. Thanks a lot!
2017-07-22Rename {NonZero,Shared,Unique}::new to new_uncheckedSimon Sapin-4/+4
2017-07-08Add tests for reaching the end of RangeInclusive as an iteratorSimon Sapin-0/+20
2017-07-08Add tests for Range*::nthSimon Sapin-0/+51
2017-07-04Auto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichtonbors-27/+16
Delete deprecated & unstable range-specific `step_by` Using the new one is annoying while this one exists, since the inherent method hides the one on iterator. Tracking issue: #27741 Replacement: #41439 Deprecation: #42310 for 1.19 Fixes #41477
2017-07-02Remove the remaining feature gatesStjepan Glavina-1/+0
2017-07-01Delete deprecated & unstable range-specific `step_by`Scott McMurray-27/+16
Replacement: 41439 Deprecation: 42310 for 1.19 Fixes 41477
2017-06-20Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichtonCorey Farwell-0/+11
add `FromStr` Impl for `char` fixes #24939. is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?
2017-06-20added `FromStr` Impl for `char`tinaun-0/+11
2017-06-16Auto merge of #42430 - nagisa:core-float, r=alexcrichtonbors-0/+55
Re-implement float min/max in rust This also adds the relevant implementations into libcore. See #42423
2017-06-16Auto merge of #42631 - malbarbo:wasm32, r=alexcrichtonbors-0/+8
Add a travis builder for wasm32-unknown-emscripten This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites. - Emscripten for asmjs was updated to sdk-1.37.13-64bit - The tests are run with node 8.0.0 (it can execute wasm) - A wrapper script is used to run each test from the directory where it is (workaround for https://github.com/kripken/emscripten/issues/4542) - Some tests are ignore, see #42629 and #42630
2017-06-14Re-implement float min/max in rustSimonas Kazlauskas-0/+55
See #42423
2017-06-13Ignore some failing test on wasm32-unknown-emscriptenMarco A L Barbosa-0/+8
See #42629 and #42630.
2017-06-06Add max and min default fns to Ord traitNick Whitney-0/+11
Pursuant to issue #25663, this commit adds the max and min functions to the Ord trait, enabling items that implement Ord to use UFCS (ex. 1.max(2)) instead of the longer std::cmp::max(1,2) format.
2017-06-02Rollup merge of #42310 - scottmcm:deprecate-range-stepby, r=alexcrichtonMark Simulacrum-13/+21
Deprecate range-specific `step_by` Deprecation attributes and test updates only. Was replaced by an any-iterator version in https://github.com/rust-lang/rust/pull/41439 Last follow-up (this release) to https://github.com/rust-lang/rust/pull/42110#issuecomment-303210138 r? @alexcrichton
2017-06-02Auto merge of #41670 - scottmcm:slice-rotate, r=alexcrichtonbors-0/+17
Add an in-place rotate method for slices to libcore A helpful primitive for moving chunks of data around inside a slice. For example, if you have a range selected and are drag-and-dropping it somewhere else (Example from [Sean Parent's talk](https://youtu.be/qH6sSOr-yk8?t=560)). (If this should be an RFC instead of a PR, please let me know.) Edit: changed example
2017-05-31Avoid range::step_by in another testScott McMurray-2/+2
2017-05-31Deprecate Range*::step_byScott McMurray-13/+21
Changed all the tests except test_range_step to use Iterator::step_by.
2017-05-30RangeFrom should have an infinite size_hintScott McMurray-0/+1
This makes the size_hint from things like `take` more precise.
2017-05-28Auto merge of #42167 - scottmcm:iter-stepby-sizehint, r=alexcrichtonbors-0/+75
Override size_hint and propagate ExactSizeIterator for iter::StepBy Generally useful, but also a prerequisite for moving a bunch of unit tests off `Range*::step_by`. A small non-breaking subset of https://github.com/rust-lang/rust/pull/42110 (which I closed). Includes two small documentation changes @ivandardi requested on that PR. r? @alexcrichton
2017-05-23Override size_hint and propagate ExactSizeIterator for iter::StepByScott McMurray-0/+75
Generally useful, but also a prerequisite for moving a bunch of unit tests off Range::step_by.
2017-05-21Return a correct size_hint for degenerate inclusive rangesScott McMurray-0/+5
Fixes https://github.com/rust-lang/rust/issues/42135 Found while fixing run-pass/range_inclusive test failure.
2017-05-21Stop returning k from [T]::rotateScott McMurray-2/+2
2017-05-21Add an in-place rotate method for slices to libcoreScott McMurray-0/+17
A helpful primitive for moving chunks of data around inside a slice. In particular, adding elements to the end of a Vec then moving them somewhere else, as a way to do efficient multiple-insert. (There's drain for efficient block-remove, but no easy way to block-insert.) Talk with another example: <https://youtu.be/qH6sSOr-yk8?t=560>
2017-05-21Make RangeInclusive just a two-field structScott McMurray-1/+18
Not being an enum improves ergonomics, especially since NonEmpty could be Empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements RFC 1980
2017-05-12Fix commit derp and update implementations and documentationIvan Dardi-1/+29
2017-05-04fallout from NonZero/Unique/Shared changesAlexis Beingessner-6/+6
2017-04-26Rollup merge of #41493 - scottmcm:fix-step-replace, r=sfacklerAriel Ben-Yehuda-0/+40
Step::replace_one should put a one, not a zero (Issue #41492) Turns out all six of the replace_* impls were backwards.
2017-04-23Step::replace_one should put a one, not a zero (Issue #41492)Scott McMurray-0/+40
Turns out all six of these impls are incorrect.
2017-04-20Remove float_extrasJosh Stone-12/+35
[unstable, deprecated since 1.11.0]
2017-04-09Auto merge of #41154 - bluss:slice-rfind, r=alexcrichtonbors-0/+14
Implement .rfind() for slice iterators Iter and IterMut Just like the forward case find, implement rfind explicitly for slice iterators Iter and IterMut.
2017-04-08slice: Implement .rfind() for slice iterators Iter and IterMutUlrik Sverdrup-0/+14
Just like the forward case find, implement rfind explicitly
2017-04-07Optimize AtomicBool::fetch_nandStjepan Glavina-1/+14
2017-04-03Move libXtest into libX/testsStjepan Glavina-0/+7661
This change moves: 1. `libcoretest` into `libcore/tests` 2. `libcollectionstest` into `libcollections/tests` This is a follow-up to #39561.