summary refs log tree commit diff
path: root/src/libcore/tests
AgeCommit message (Collapse)AuthorLines
2019-08-09Rollup merge of #63407 - RalfJung:miri-test-sizes, r=CentrilMazdak Farrokhzad-1/+1
reduce some test sizes in Miri
2019-08-09Rollup merge of #63404 - RalfJung:flt2dec, r=CentrilMazdak Farrokhzad-7/+42
enable flt2dec tests in Miri With ldexp implemented (thanks to @christianpoveda), we can finally enable these tests in Miri. Well, most of them -- some are just too slow.
2019-08-09Rollup merge of #63403 - sntdevco:master, r=CentrilMazdak Farrokhzad-9/+9
Improve test output I'm continuing to improve the test output for liballoc and libcore
2019-08-09explain Miri disablingRalf Jung-1/+1
2019-08-09Miri is really slowRalf Jung-4/+5
2019-08-09enable flt2dec tests in MiriRalf Jung-7/+41
2019-08-09Merge pull request #1 from rust-lang/masterSayan Nandan-216/+1141
Merge recent changes into master
2019-08-09Improve tests for libcore/sliceSayan Nandan-8/+8
2019-08-09Improve test output for libcore/timeSayan Nandan-3/+1
2019-08-09Auto merge of #61937 - AaronKutch:master, r=scottmcmbors-0/+38
Improve `ptr_rotate` performance, tests, and benches The corresponding issue is #61784. I am not actually sure if miri can handle the test, but I can change the commit if necessary.
2019-08-08Rollup merge of #63261 - RalfJung:rand, r=nikomatsakisMazdak Farrokhzad-9/+9
bump rand in libcore/liballoc test suites This pulls in the fix for https://github.com/rust-random/rand/issues/779, which trips Miri when running these test suites. `SmallRng` (formerly used by libcore) is no longer built by default, it needs a feature gate. I opted to switch to `StdRng` instead. Or should I enable the feature gate?
2019-08-06Improve `ptr_rotate` performance, tests, and benchmarksAaron Kutch-0/+38
2019-08-06Rollup merge of #62459 - timvermeulen:result_sum_internal_iteration, r=scottmcmMazdak Farrokhzad-0/+17
Use internal iteration in the Sum and Product impls of Result and Option This PR adds internal iteration to the `ResultShunt` iterator type underlying the `Sum` and `Product` impls of `Result`. I had to change `ResultShunt` to hold a mutable reference to an error instead, similar to `itertools::ProcessResults`, in order to be able to pass the `ResultShunt` itself by value (which is necessary for internal iteration). `ResultShunt::process` can unfortunately no longer be an associated function because that would make it generic over the lifetime of the error reference, which wouldn't work, so I turned it into the free function `process_results`. I removed the `OptionShunt` type and forwarded the `Sum` and `Product` impls of `Option` to their respective impls of `Result` instead, to avoid having to repeat the internal iteration logic.
2019-08-06Rollup merge of #63260 - RalfJung:ptr-test, r=matkladMazdak Farrokhzad-2/+1
fix UB in a test We used to compare two mutable references that were supposed to point to the same thing. That's no good. Compare them as raw pointers instead.
2019-08-06Rollup merge of #61457 - timvermeulen:double_ended_iters, r=scottmcmMazdak Farrokhzad-13/+179
Implement DoubleEndedIterator for iter::{StepBy, Peekable, Take} Now that `DoubleEndedIterator::nth_back` has landed, `StepBy` and `Take` can have an efficient `DoubleEndedIterator` implementation. I don't know if there was any particular reason for `Peekable` not having a `DoubleEndedIterator` implementation, but it's quite trivial and I don't see any drawbacks to having it. I'm not very happy about the implementation of `Peekable::try_rfold`, but I didn't see another way to only take the value out of `self.peeked` in case `self.iter.try_rfold` didn't exit early. I only added `Peekable::rfold` (in addition to `try_rfold`) because its `Iterator` implementation has both `fold` and `try_fold` (and for similar reasons I added `Take::try_rfold` but not `Take::rfold`). Do we have any guidelines on whether we want both? If we do want both, maybe we should investigate which iterator adaptors override `try_fold` but not `fold` and add the missing implementations. At the moment I think that it's better to always have iterator adaptors implement both, because some iterators have a simpler `fold` implementation than their `try_fold` implementation. The tests that I added may not be sufficient because they're all just existing tests where `next`/`nth`/`fold`/`try_fold` are replaced by their DEI counterparts, but I do think all paths are covered. Is there anything in particular that I should probably also test?
2019-08-05fix slice comparisonRalf Jung-1/+1
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-05Test content, not valueRalf Jung-1/+1
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-04bump libcore tests to rand 0.7Ralf Jung-9/+9
2019-08-04fix UB in a testRalf Jung-2/+1
2019-07-29Use internal iteration in the Sum and Product impls of Result and OptionTim Vermeulen-0/+17
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-28Rollup merge of #62074 - wizAmit:feature/mut_chunks_nth_back, r=scottmcmMazdak Farrokhzad-0/+22
squash of all commits for nth_back on ChunksMut wip nth_back for chunks_mut working chunksmut fixed nth_back for chunksmut Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com> r? @timvermeulen r? @scottmcm
2019-07-26Rollup merge of #62421 - JohnTitor:U007D-master, r=alexcrichtonMazdak Farrokhzad-37/+178
Introduce `as_deref` to Option This is re-submission for #59628. Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests. CC #50264 r? @Kimundi (I picked you as you're the previous reviewer.)
2019-07-25Rollup merge of #61884 - crlf0710:stablize_euc, r=dtolnay,CentrilMazdak Farrokhzad-1/+0
Stablize Euclidean Modulo (feature euclidean_division) Closes #49048
2019-07-18renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as per ↵Brad Gibson-37/+178
discussion https://github.com/rust-lang/rust/issues/50264
2019-07-09Implement DoubleEndedIterator for iter::{StepBy, Peekable, Take}Tim Vermeulen-13/+179
2019-07-09Unit test Iterator::partition_in_place and is_partitionedJosh Stone-0/+38
2019-07-09Rollup merge of #60458 - KodrAus:debug_map_entry, r=alexcrichtonMazdak Farrokhzad-8/+86
Add key and value methods to DebugMap Implementation PR for an active (not approved) RFC: https://github.com/rust-lang/rfcs/pull/2696. Add two new methods to `std::fmt::DebugMap` for writing the key and value part of a map entry separately: ```rust impl<'a, 'b: 'a> DebugMap<'a, 'b> { pub fn key(&mut self, key: &dyn Debug) -> &mut Self; pub fn value(&mut self, value: &dyn Debug) -> &mut Self; } ``` I want to do this so that I can write a `serde::Serializer` that forwards to our format builders, so that any `T: Serialize` can also be treated like a `T: Debug`.
2019-07-08add key and value methods to DebugMapAshley Mannix-8/+86
2019-07-07Stablize Euclidean Modulo (feature euclidean_division)CrLF0710-1/+0
2019-07-04Rollup merge of #62346 - RalfJung:miri-tests, r=CentrilMazdak Farrokhzad-7/+4
enable a few more tests in Miri and update the comment for others
2019-07-03enable a few more tests in Miri and update the comment for othersRalf Jung-7/+4
2019-07-03Rollup merge of #62319 - ia0:fix_kleene, r=petrochenkovMark Rousskov-2/+2
Fix mismatching Kleene operators
2019-07-03Fix mismatching Kleene operatorsJulien Cretin-2/+2
2019-06-23squash of all commits for nth_back on ChunksMut@amit.chandra-0/+22
wip nth_back for chunks_mut working chunksmut fixed nth_back for chunksmut Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
2019-06-23squash commit for nth_back on chunks exact@amit.chandra-0/+19
wip nth_back for chunks_exact working nth_back for chunks exact Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
2019-06-20Rollup merge of #60772 - timvermeulen:slice_iter_nth_back, r=scottmcmMazdak Farrokhzad-0/+13
Implement nth_back for slice::{Iter, IterMut} Part of #54054. I implemented `nth_back` as straightforwardly as I could, and then slightly changed `nth` to match `nth_back`. I believe I did so correctly, but please double-check 🙂 I also added the helper methods `zst_shrink`, `next_unchecked`, and `next_back_unchecked` to get rid of some duplicated code. These changes hopefully make this code easier to understand for new contributors like me. I noticed the `is_empty!` and `len!` macros which sole purpose seems to be inlining, according to the comment right above them, but the `is_empty` and `len` methods are already marked with `#[inline(always)]`. Does that mean we could replace these macros with method calls, without affecting anything? I'd love to get rid of them.
2019-06-20Rollup merge of #60454 - acrrd:issues/54054_skip, r=scottmcmMazdak Farrokhzad-0/+34
Add custom nth_back to Skip Implementation of nth_back for Skip. Part of #54054
2019-06-13Rollup merge of #61398 - kennytm:stabilize-copy-within, r=SimonSapinMazdak Farrokhzad-1/+14
Stabilize copy_within Closes #54236.
2019-06-12Rollup merge of #61671 - koalatux:nth-back-range, r=KodrAusMazdak Farrokhzad-0/+37
implement nth_back for Range(Inclusive) This is part of #54054.
2019-06-09implement nth_back for RangeInclusiveAdrian Friedli-0/+20
2019-06-09Miri: disable a slow testRalf Jung-0/+2
2019-06-08implement nth_back for RangeAdrian Friedli-0/+17
2019-06-06Rollup merge of #61376 - czipperz:bound-cloned, r=sfacklerMazdak Farrokhzad-1/+17
Add Bound::cloned() Suggested by #61356
2019-06-04Update src/libcore/tests/slice.rskennytm-1/+1
Co-Authored-By: Jack O'Connor <oconnor663@gmail.com>
2019-06-02copy_within: replace element access by pointer arithmetic to avoid UBkennytm-0/+14
This ensures we won't accidentally read *src or *dest even when count = 0.
2019-06-01Enable feature bound_cloned for testsChris Gregory-0/+1
2019-06-01Rollup merge of #61364 - lzutao:stabilize-reverse_bits, r=CentrilMazdak Farrokhzad-1/+0
Stabilize reverse_bits feature FCP done in https://github.com/rust-lang/rust/issues/48763#issuecomment-497349379 Closes #48763 r? @Centril
2019-05-31Import Bound in testsChris Gregory-1/+1
2019-05-31Add Bound testsChris Gregory-0/+15