Skip to content

Commit bd6d923

Browse files
committed
fix typos in test
1 parent 60d0701 commit bd6d923

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/common_tests.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TEST_CASE("Testing Shape", "[Shape]")
3636
CHECK(s != n);
3737
}
3838

39-
SECTION("Shape comutation") {
39+
SECTION("Shape computation") {
4040
Shape stride = shapeToStride(s);
4141
CHECK(stride.size() == s.size());
4242
CHECK(stride == Shape({5,1}));
@@ -109,7 +109,7 @@ TEST_CASE("Testing Tensor", "[Tensor]")
109109
CHECK(q.dtype() == t.dtype());
110110
CHECK(q.shape() == t.shape());
111111
CHECK(q.backend() == t.backend());
112-
CHECK(q.shape() == zeros_like(t).shape()); //Lazy way to check if zeros_like works too
112+
CHECK(q.isSame(t) == true);
113113
}
114114

115115
SECTION("Tesnor basic") {
@@ -245,12 +245,12 @@ TEST_CASE("Testing Tensor", "[Tensor]")
245245
CHECK(t[r].isSame(t.view(r)));
246246
}
247247

248-
SECTION("assign to subscription") {
248+
SECTION("assign to subscription (scalar)") {
249249
t[{2, 2}] = t[{2, 2}] + 1;
250250
CHECK(t[{2, 2}].item<int>() == 11);
251251
}
252252

253-
SECTION("self increment and assign") {
253+
SECTION("assign to subscription (vector)") {
254254
t[{2}] = t[{2}] + 1;
255255
//Check a subset of weather the result is correct
256256
CHECK(t[{2, 2}].item<int>() == 11);
@@ -260,9 +260,11 @@ TEST_CASE("Testing Tensor", "[Tensor]")
260260
SECTION("item") {
261261
Tensor t = ones({1});
262262
CHECK(t.item<int>() == 1);
263+
// item() should fail because asking for the wrong type
263264
CHECK_THROWS(t.item<float>());
264265

265266
Tensor q = ones({2});
267+
// item() should fail because q is not a scalar
266268
CHECK_THROWS(q.item<int>());
267269
}
268270
}

0 commit comments

Comments
 (0)