mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Added unittest to show relative slicing behaviour more clearly.
This commit is contained in:
parent
696256c76b
commit
cf18f2823d
1 changed files with 5 additions and 0 deletions
|
@ -4431,8 +4431,13 @@ unittest
|
|||
{
|
||||
auto odds = sequence!("a[0] + n * a[1]")(1, 2);
|
||||
|
||||
// static slicing tests
|
||||
assert(equal(odds[0 .. 5], take(odds, 5)));
|
||||
assert(equal(odds[3 .. 7], take(drop(odds, 3), 4)));
|
||||
|
||||
// relative slicing test, testing slicing is agnostic of state
|
||||
odds = drop(odds, 5);
|
||||
assert(equal(odds[5 .. 9], take(odds, 4)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue