mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Reversed test
This commit is contained in:
parent
d9e5253fdf
commit
ea5e5fd82a
1 changed files with 11 additions and 2 deletions
|
@ -154,10 +154,16 @@ namespace Tests
|
|||
total += i;
|
||||
Test.Assert(total == 10+20+30+40+50+60+70+80);
|
||||
|
||||
int itr = 0;
|
||||
total = 0;
|
||||
for (int i in iList[...^2][1...^2])
|
||||
for (int i in iList[...^2][1...^2].Reversed)
|
||||
{
|
||||
if (itr == 1)
|
||||
Test.Assert(i == 70);
|
||||
total += i;
|
||||
Test.Assert(total == 20+30+40+50+60+70+80);
|
||||
++itr;
|
||||
}
|
||||
Test.Assert(total == 80+70+60+50+40+30+20);
|
||||
|
||||
var str = scope String();
|
||||
(2...^3).ToString(str);
|
||||
|
@ -165,6 +171,9 @@ namespace Tests
|
|||
|
||||
int[] iEmptyArr = scope .();
|
||||
var emptySpan = iEmptyArr[...];
|
||||
|
||||
for (var i in emptySpan.Reversed)
|
||||
Test.FatalError();
|
||||
}
|
||||
|
||||
public static void TestEnumerator1(EnumeratorTest e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue