about summary refs log tree commit diff
path: root/src/liballoc/tests
AgeCommit message (Collapse)AuthorLines
2018-10-18Stabilize slice::rchunks(), rchunks_mut(), rchunks_exact(), rchunk_exact_mut()Sebastian Dröge-1/+0
Fixes #55177
2018-10-18Stabilize slice::chunks_exact() and slice::chunks_exact_mut()Sebastian Dröge-1/+0
Fixes #47115
2018-10-18Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut()Sebastian Dröge-2/+115
These work exactly like the normal chunks iterators but start creating chunks from the end of the slice. See #55177 for the tracking issue
2018-10-05Stabilize `min_const_fn`Oliver Schneider-1/+1
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-2/+1
2018-09-24Rename slice::exact_chunks() to slice::chunks_exact()Sebastian Dröge-16/+16
See https://github.com/rust-lang/rust/issues/47115#issuecomment-403090815 and https://github.com/rust-lang/rust/issues/47115#issuecomment-424053547
2018-09-05Auto merge of #52994 - varkor:trim_direction, r=alexcrichtonbors-30/+38
Add trim_start, trim_end etc.; deprecate trim_left, trim_right, etc. in future Adds the methods: `trim_start`, `trim_end`, `trim_start_matches` and `trim_end_matches`. Deprecates `trim_left`, `trim_right`, `trim_left_matches` and `trim_right_matches` starting from Rust 1.33.0, three versions from when they'll initially be marked as being deprecated, using the future deprecation from https://github.com/rust-lang/rust/issues/30785 and https://github.com/rust-lang/rust/pull/51681. Fixes https://github.com/rust-lang/rust/issues/30459.
2018-09-04Breaking change upgradesMark Rousskov-2/+3
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+2
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-1/+0
2018-08-19Remove old testsvarkor-50/+0
2018-08-18Auto merge of #52553 - Pazzaz:vecdeque-append, r=SimonSapinbors-0/+101
Non-naive implementation of `VecDeque.append` Replaces the old, simple implementation with a more manual (and **unsafe** 😱) one. I've added 1 more test and verified that it covers all 6 code paths in the function. This new implementation was about 60% faster than the old naive one when I tried benchmarking it.
2018-08-15Test VecDeque append not dropping twicePazzaz-0/+25
2018-08-05Make features stable and clarify examplesvarkor-1/+0
2018-08-05Fix stage 2 testsvarkor-2/+0
2018-08-05Remove unnecessary or invalid feature attributesvarkor-1/+0
2018-08-02Add trim_start, trim_end, trim_start_matches and trim_end_matchesvarkor-0/+59
2018-07-28Rollup merge of #52769 - sinkuu:stray_test, r=alexcrichtonkennytm-0/+12
Incorporate a stray test `liballoc/repeat-generic-slice.rs` doesn't seem to be tested (I think it was intended to be placed in `run-pass`). This PR incorporates the test into `liballoc/tests`.
2018-07-27Incorporate a stray testShotaro Yamada-0/+12
2018-07-25Add missing dynTatsuyuki Ishi-8/+8
2018-07-22Simplify vecdeque append testPazzaz-42/+64
2018-07-22Rollup merge of #51807 - newpavlov:deprecate_str_slice, r=alexcrichtonkennytm-4/+4
Deprecation of str::slice_unchecked(_mut) Closes #51715 I am not sure if 1.28.0 or 1.29.0 should be used for deprecation version, for now it's 1.28.0. Additionally I've replaced `slice_unchecked` uses with `get_unchecked`. The only places where this method is still used are `src/liballoc/tests/str.rs` and `src/liballoc/tests/str.rs`.
2018-07-19Non-naive implementation for `VecDeque.append`Pazzaz-0/+54
2018-07-07Add some unit tests for dangling Weak referencesSimon Sapin-0/+112
2018-06-26removed slice_uncheked from src/liballoc/tests/str.rsnewpavlov-4/+4
2018-06-10Auto merge of #51320 - tmccombs:step-by, r=SimonSapinbors-1/+0
Stabilize Iterator::step_by Fixes #27741
2018-06-02Stabilize Iterator::step_byThayne McCombs-1/+0
Fixes #27741
2018-06-03impl Default for &mut strkennytm-0/+1
2018-06-01add more join testsEmerentius-0/+22
old tests cover the new fast path of str joining already this adds tests for joining into Strings with long separators (>4 byte) and for joining into Vec<T>, T: Clone + !Copy. Vec<T: Copy> will be specialised when specialisation type inference bugs are fixed.
2018-05-21Auto merge of #49283 - varkor:combining-chars-escape_debug, r=SimonSapinbors-0/+7
Escape combining characters in char::Debug Although combining characters are technically printable, they make little sense to print on their own with `Debug`: it'd be better to escape them like non-printable characters. This is a breaking change, but I imagine the fact `escape_debug` is rare and almost certainly primarily used for debugging that this is an acceptable change. Resolves #41922. r? @alexcrichton cc @clarcharr
2018-05-21Avoid counting characters and add explanatory comment to testvarkor-0/+6
2018-05-21Only escape extended grapheme characters in the first positionvarkor-1/+1
2018-05-21Make {char, str}::escape_debug and impl Debug for {char, str} consistentvarkor-0/+1
2018-05-17Stabilise inclusive_range_methodsvarkor-1/+0
2018-05-10Skip a memory-hungry test that OOMsAlex Crichton-0/+1
Attempting to fix https://travis-ci.org/rust-lang/rust/jobs/377407894 via some selective ignoring tests
2018-05-10Rollup merge of #50010 - ExpHP:slice-bounds, r=alexcrichtonAlex Crichton-134/+355
Give SliceIndex impls a test suite of girth befitting the implementation (and fix a UTF8 boundary check) So one day I was writing something in my codebase that basically amounted to `impl SliceIndex for (Bound<usize>, Bound<usize>)`, and I said to myself: *Boy, gee, golly! I never realized bounds checking was so tricky!* At some point when I had around 60 lines of tests for it, I decided to go see how the standard library does it to see if I missed any edge cases. ...That's when I discovered that libcore only had about 40 lines of tests for slicing altogether, and none of them even used `..=`. --- This PR includes: * **Literally the first appearance of the word `get_unchecked_mut` in any directory named `test` or `tests`.** * Likewise the first appearance of `get_mut` used with _any type of range argument_ in these directories. * Tests for the panics on overflow with `..=`. * I wanted to test on `[(); usize::MAX]` as well but that takes linear time in debug mode </3 * A horrible and ugly test-generating macro for the `should_panic` tests that increases the DRYness by a single order of magnitude (which IMO wasn't enough, but I didn't want to go any further and risk making the tests inaccessible to next guy). * Same stuff for str! * Actually, the existing `str` tests were pretty good. I just helped filled in the holes. * [A fix for the bug it caught](https://github.com/rust-lang/rust/issues/50002). (only one ~~sadly~~)
2018-05-01Auto merge of #49724 - kennytm:range-inc-start-end-methods, r=Kimundibors-1/+1
Introduce RangeInclusive::{new, start, end} methods and make the fields private. cc #49022
2018-04-30revise test gen macro for strMichael Lamparski-144/+81
2018-04-30Make the fields of RangeInclusive private.kennytm-1/+1
Added new()/start()/end() methods to RangeInclusive. Changed the lowering of `..=` to use RangeInclusive::new().
2018-04-30decrease false negatives for str overflow testMichael Lamparski-1/+3
2018-04-30flesh out tests for SliceIndexMichael Lamparski-99/+378
m*n lines of implementation deserves m*n lines of tests
2018-04-30collect str SliceIndex tests into a modMichael Lamparski-137/+140
GitHub users: I think you can add ?w=1 to the url for a vastly cleaner whitespace-ignoring diff
2018-04-28stabilize `#[must_use]` for functions and must-use operatorsZack M. Davis-0/+1
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-18fix my unit test that was horrendously wrongMichael Lamparski-3/+17
and add one for non-mut slicing since I touched that method too
2018-04-17smaller PR just to fix #50002Michael Lamparski-0/+16
2018-04-12Use NonNull<Void> instead of *mut u8 in the Alloc traitMike Hommey-1/+2
Fixes #49608
2018-04-12Remove the now-unit-struct AllocErr field inside CollectionAllocErrSimon Sapin-20/+20
2018-04-12Actually deprecate the Heap typeSimon Sapin-2/+2
2018-04-12Mark the rest of the `unicode` feature flag as perma-unstable.Simon Sapin-1/+0
2018-04-12Merge unstable Utf16Encoder into EncodeUtf16Simon Sapin-2/+1