Skip to content

Commit

Permalink
Drop conditional testing on Mono (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz authored Sep 22, 2024
1 parent ede868e commit 5dc9e18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
21 changes: 4 additions & 17 deletions MoreLinq.Test/TransposeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void TransposeWithRowsOfSameLength()
using var row3 = TestingSequence.Of(30, 31, 32, 33);
using var matrix = TestingSequence.Of(row1, row2, row3);

AssertMatrix(expectations, matrix.Transpose());
Assert.That(matrix.Transpose(), Is.EqualTo(expectations));
}

[Test]
Expand All @@ -77,7 +77,7 @@ public void TransposeWithRowsOfDifferentLengths()
using var row4 = TestingSequence.Of(30, 31, 32);
using var matrix = TestingSequence.Of(row1, row2, row3, row4);

AssertMatrix(expectations, matrix.Transpose());
Assert.That(matrix.Transpose(), Is.EqualTo(expectations));
}

[Test]
Expand Down Expand Up @@ -116,7 +116,7 @@ public void TransposeWithAllRowsAsInfiniteSequences()
[32, 243, 3125]
};

AssertMatrix(expectations, result);
Assert.That(result, Is.EqualTo(expectations));
}

[Test]
Expand All @@ -139,7 +139,7 @@ public void TransposeWithSomeRowsAsInfiniteSequences()
[32, 3125]
};

AssertMatrix(expectations, result);
Assert.That(result, Is.EqualTo(expectations));
}

[Test]
Expand Down Expand Up @@ -207,18 +207,5 @@ static bool IsPrime(int number)

return true;
}

static void AssertMatrix<T>(IEnumerable<IEnumerable<T>> expectation, IEnumerable<IEnumerable<T>> result)
{
// necessary because NUnitLite 3.6.1 (.NET 4.5) for Mono don't assert nested enumerables

var resultList = result.ToList();
var expectationList = expectation.ToList();

Assert.That(resultList.Count, Is.EqualTo(expectationList.Count));

expectationList.Zip(resultList, ValueTuple.Create)
.ForEach(t => t.Item1.AssertSequenceEqual(t.Item2));
}
}
}
8 changes: 0 additions & 8 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,5 @@ dotnet reportgenerator -reports:MoreLinq.Test/TestResults/coverage-*.opencover.x
-reporttypes:Html\;TextSummary \
-targetdir:MoreLinq.Test/TestResults/reports
cat MoreLinq.Test/TestResults/reports/Summary.txt
if [[ -z `which mono 2>/dev/null` ]]; then
echo>&2 NOTE! Mono does not appear to be installed so unit tests
echo>&2 against the Mono runtime will be skipped.
else
for c in $configs; do
mono MoreLinq.Test/bin/$c/net471/MoreLinq.Test.exe
done
fi
dotnet publish MoreLinq.Test.Aot
"$(find MoreLinq.Test.Aot -type d -name publish)/MoreLinq.Test.Aot"

0 comments on commit 5dc9e18

Please sign in to comment.