1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Reversed test

This commit is contained in:
Brian Fiete 2021-10-26 10:33:08 -07:00
parent d9e5253fdf
commit ea5e5fd82a

View file

@ -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)