Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Fix failing tests for lint pipeline #743

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions dynamic/subsetsum_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package dynamic

import (
"fmt"
"testing"
)
import "testing"

func TestSubsetSum(t *testing.T) {

Expand Down Expand Up @@ -74,7 +71,7 @@ func TestSubsetSum(t *testing.T) {

for i := range subsetSumTestData {

t.Run(fmt.Sprintf(subsetSumTestData[i].description), func(t *testing.T) {
t.Run(subsetSumTestData[i].description, func(t *testing.T) {
array := subsetSumTestData[i].array
sum := subsetSumTestData[i].sum

Expand Down
4 changes: 2 additions & 2 deletions math/matrix/matrix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestNewFromElements(t *testing.T) {
for j := 0; j < len(validElements[0]); j++ {
err := expectedm1.Set(i, j, validElements[i][j])
if err != nil {
t.Errorf("copyMatrix.Set error: " + err.Error())
t.Errorf("copyMatrix.Set error: %s", err.Error())
}
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ func TestMatrixGet(t *testing.T) {
matrix := matrix.New(3, 3, 0)
err := matrix.Set(1, 1, 42) // Set a specific value for testing
if err != nil {
t.Errorf("copyMatrix.Set error: " + err.Error())
t.Errorf("copyMatrix.Set error: %s", err.Error())
}
// Test case 1: Valid Get
val1, err1 := matrix.Get(1, 1)
Expand Down
4 changes: 2 additions & 2 deletions math/matrix/strassenmatrixmultiply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestStrassenMatrixMultiply(t *testing.T) {
}
}
func TestMatrixMultiplication(t *testing.T) {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

// Generate random matrices for testing
size := 1 << (rand.Intn(8) + 1) // tests for matrix with n as power of 2
Expand Down Expand Up @@ -103,7 +103,7 @@ func TestMatrixMultiplication(t *testing.T) {
}

func MakeRandomMatrix[T constraints.Integer](rows, columns int) matrix.Matrix[T] {
rand.Seed(time.Now().UnixNano())
rand.New(rand.NewSource(time.Now().UnixNano()))

matrixData := make([][]T, rows)
for i := 0; i < rows; i++ {
Expand Down
Loading