Skip to content

Commit

Permalink
NDArray.Indexing.Test: removed invalid assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nucs committed Apr 30, 2021
1 parent a9782b8 commit 1fed94d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/NumSharp.UnitTest/Selection/NDArray.Indexing.Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void MaskSetter()
[TestMethod]
public void Compare()
{
throw new Exception("This test causes memory corruption");
throw new Exception("This test kills test engine process due to Debug.Assert");
NDArray nd = new double[,] { { 1, 2, 3 }, { 4, 5, 6 } };
(nd < 3).Should().BeOfValues(true, true, false, false, false, false);

Expand Down Expand Up @@ -1330,55 +1330,55 @@ public void IndexNDArray_Set_Case1()
{
var a = np.arange(8).reshape(2,4);
a["1, :"] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2,4).And.BeOfValues(0,1,2,3,0,1,2,3);
a.Should().BeShaped(2,4).And.BeOfValues(0,1,2,3,0,1,2,3);
}

[TestMethod]
public void IndexNDArray_Set_Case2()
{
var a = np.arange(8).reshape(2, 4);
a[1, np.arange(4)] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
a.Should().BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
}

[TestMethod]
public void IndexNDArray_Set_Case3()
{
var a = np.arange(8).reshape(2, 4);
a[np.array(1), np.arange(4)] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
a.Should().BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
}

[TestMethod]
public void IndexNDArray_Set_Case4()
{
var a = np.arange(8).reshape(2, 4);
a["1:2", np.arange(4)] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
a.Should().BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
}

[TestMethod]
public void IndexNDArray_Set_Case5()
{
var a = np.arange(8).reshape(2, 4);
a["1:2", Slice.All] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
a.Should().BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
}

[TestMethod]
public void IndexNDArray_Set_Case6()
{
var a = np.arange(8).reshape(2, 4);
a[Slice.Index(1), Slice.All] = np.arange(4);
a.Should().AllValuesBe(8).And.BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
a.Should().BeShaped(2, 4).And.BeOfValues(0, 1, 2, 3, 0, 1, 2, 3);
}

[TestMethod]
public void IndexNDArray_Set_Case7_Boolean()
{
var a = np.arange(8);
a[true] = 1;
a.Should().AllValuesBe(8).And.BeShaped(8);
a.Should().BeShaped(8);
}

[TestMethod]
Expand Down

0 comments on commit 1fed94d

Please sign in to comment.