(t *testing.T)
| 7 | ) |
| 8 | |
| 9 | func TestMatrixMatchDimensions(t *testing.T) { |
| 10 | // Create two matrices with the same dimensions |
| 11 | m1 := matrix.New(2, 3, 0) |
| 12 | m2 := matrix.New(2, 3, 0) |
| 13 | |
| 14 | // Test case 1: Same dimensions |
| 15 | if !m1.MatchDimensions(m2) { |
| 16 | t.Errorf("m1.MatchDimensions(m2) returned %t, expected 1 (same dimensions)", m1.MatchDimensions(m2)) |
| 17 | } |
| 18 | |
| 19 | // Create two matrices with different dimensions |
| 20 | m3 := matrix.New(2, 3, 0) |
| 21 | m4 := matrix.New(3, 2, 0) |
| 22 | |
| 23 | // Test case 2: Different dimensions |
| 24 | if m3.MatchDimensions(m4) { |
| 25 | t.Errorf("m3.MatchDimensions(m4) returned : %v, expected: %v", m3.MatchDimensions(m4), false) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | // BenchmarkMatchDimensions benchmarks the MatchDimensions method. |
| 30 | func BenchmarkMatchDimensions(b *testing.B) { |
nothing calls this directly
no test coverage detected