(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func TestEmptyMatrix(t *testing.T) { |
| 49 | emptyElements := [][]int{} |
| 50 | matrix, err := matrix.NewFromElements(emptyElements) |
| 51 | |
| 52 | if err != nil { |
| 53 | t.Fatalf("Error creating Matrix with empty elements: %v", err) |
| 54 | } |
| 55 | |
| 56 | determinant, err := matrix.Determinant() |
| 57 | |
| 58 | if err != nil { |
| 59 | t.Fatalf("Determinant returned an error for empty matrix: %v", err) |
| 60 | } |
| 61 | |
| 62 | // Check that 0 is returned from an empty matrix. |
| 63 | expectedValue := 0 |
| 64 | if determinant != expectedValue { |
| 65 | t.Errorf("Determinant returned from empty matrix was %d; wanted %d", determinant, expectedValue) |
| 66 | } |
| 67 | |
| 68 | } |
| 69 | |
| 70 | func TestNonSquareMatrix(t *testing.T) { |
| 71 | // Creating non-square matrix for testing. |
nothing calls this directly
no test coverage detected