(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestNewMatrix(t *testing.T) { |
| 11 | |
| 12 | nullMatrix := matrix.New(0, 0, 0) |
| 13 | if nullMatrix.Rows() != 0 || nullMatrix.Columns() != 0 { |
| 14 | t.Errorf("matrix.New( 0, 0, 0) returned nil, expected a matrix") |
| 15 | } |
| 16 | // Test creating a matrix of integers |
| 17 | intMatrix := matrix.New(3, 4, 0) |
| 18 | if intMatrix.Rows() != 3 || intMatrix.Columns() != 4 { |
| 19 | t.Errorf("matrix.New( 3, 4, 0) returned nil, expected a matrix") |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | |
| 24 | func TestNewFromElements(t *testing.T) { |
| 25 | // Test case 1: Valid matrix |