rust/library/alloc/tests
Martin von Zweigbergk f6e4c742f4 Make split_inclusive() on an empty slice yield an empty output
`[].split_inclusive()` currently yields a single, empty slice. That's
different from `"".split_inslusive()`, which yields no output at
all. I think that makes the slice version harder to use.

The case where I ran into this bug was when writing code for
generating a diff between two slices of bytes. I wanted to prefix
removed lines with "-" and a added lines with "+". Due to
`split_inclusive()`'s current behavior, that means that my code prints
just a "-" or "+" for empty files. I suspect most existing callers
have similar "bugs" (which would be fixed by this patch).

Closes #89716.
2021-10-12 08:34:03 -07:00
..
arc.rs Add Weak may_dangle tests 2021-05-20 19:42:29 -07:00
binary_heap.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
borrow.rs Move various ui const tests to library 2020-09-04 02:35:27 +02:00
boxed.rs Fix grammar 2021-08-24 17:56:39 +02:00
btree_set_hash.rs Include the length in BTree hashes 2021-10-01 12:29:09 -07:00
const_fns.rs BTree: remove Ord bound from new 2021-08-18 03:55:36 +01:00
cow_str.rs
fmt.rs Auto merge of #78618 - workingjubilee:ieee754-fmt, r=m-ou-se 2021-03-27 10:40:16 +00:00
heap.rs Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
lib.rs Rollup merge of #87993 - kornelski:try_reserve_stable, r=joshtriplett 2021-10-04 21:12:33 -07:00
linked_list.rs
rc.rs Add Weak may_dangle tests 2021-05-20 19:42:29 -07:00
slice.rs Make split_inclusive() on an empty slice yield an empty output 2021-10-12 08:34:03 -07:00
str.rs Add test for the fix 2021-07-11 17:47:57 +02:00
string.rs Use assert_matches! instead of if let {} else 2021-08-07 14:48:27 +01:00
vec_deque.rs Use assert_matches! instead of if let {} else 2021-08-07 14:48:27 +01:00
vec.rs implement advance_(back_)_by on more iterators 2021-09-30 21:23:28 +02:00