File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 11package dynamic
22
3- import (
4- "fmt"
5- "testing"
6- )
3+ import "testing"
74
85func TestSubsetSum (t * testing.T ) {
96
@@ -74,7 +71,7 @@ func TestSubsetSum(t *testing.T) {
7471
7572 for i := range subsetSumTestData {
7673
77- t .Run (fmt . Sprintf ( subsetSumTestData [i ].description ) , func (t * testing.T ) {
74+ t .Run (subsetSumTestData [i ].description , func (t * testing.T ) {
7875 array := subsetSumTestData [i ].array
7976 sum := subsetSumTestData [i ].sum
8077
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ func TestNewFromElements(t *testing.T) {
3232 for j := 0 ; j < len (validElements [0 ]); j ++ {
3333 err := expectedm1 .Set (i , j , validElements [i ][j ])
3434 if err != nil {
35- t .Errorf ("copyMatrix.Set error: " + err .Error ())
35+ t .Errorf ("copyMatrix.Set error: %s" , err .Error ())
3636 }
3737 }
3838 }
@@ -73,7 +73,7 @@ func TestMatrixGet(t *testing.T) {
7373 matrix := matrix .New (3 , 3 , 0 )
7474 err := matrix .Set (1 , 1 , 42 ) // Set a specific value for testing
7575 if err != nil {
76- t .Errorf ("copyMatrix.Set error: " + err .Error ())
76+ t .Errorf ("copyMatrix.Set error: %s" , err .Error ())
7777 }
7878 // Test case 1: Valid Get
7979 val1 , err1 := matrix .Get (1 , 1 )
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ func TestStrassenMatrixMultiply(t *testing.T) {
6666 }
6767}
6868func TestMatrixMultiplication (t * testing.T ) {
69- rand .Seed ( time .Now ().UnixNano ())
69+ rand .New ( rand . NewSource ( time .Now ().UnixNano () ))
7070
7171 // Generate random matrices for testing
7272 size := 1 << (rand .Intn (8 ) + 1 ) // tests for matrix with n as power of 2
@@ -103,7 +103,7 @@ func TestMatrixMultiplication(t *testing.T) {
103103}
104104
105105func MakeRandomMatrix [T constraints.Integer ](rows , columns int ) matrix.Matrix [T ] {
106- rand .Seed ( time .Now ().UnixNano ())
106+ rand .New ( rand . NewSource ( time .Now ().UnixNano () ))
107107
108108 matrixData := make ([][]T , rows )
109109 for i := 0 ; i < rows ; i ++ {
You can’t perform that action at this time.
0 commit comments