From ea5e5fd82a75d41fca6bee54e6845a535b8005fd Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 26 Oct 2021 10:33:08 -0700 Subject: [PATCH] Reversed test --- IDEHelper/Tests/src/Loops.bf | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Tests/src/Loops.bf b/IDEHelper/Tests/src/Loops.bf index cc725da1..9909ec56 100644 --- a/IDEHelper/Tests/src/Loops.bf +++ b/IDEHelper/Tests/src/Loops.bf @@ -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)