Browse Source

Better logging for dtw gss idmb tests

* Logf
sdsadfaf 3 years ago
parent
commit
8e93c2479a

+ 3 - 4
internal/pkg/dtw/fast_dtw_test.go

@@ -1,7 +1,6 @@
 package dtw
 package dtw
 
 
 import (
 import (
-	"fmt"
 	"testing"
 	"testing"
 )
 )
 
 
@@ -11,6 +10,6 @@ func TestFastDTW(t *testing.T) {
 	//var balance2 = TimeSeries{1, 2, 3.1, 4, 5}
 	//var balance2 = TimeSeries{1, 2, 3.1, 4, 5}
 	d, b := FastDTW(balance1, balance2, 1)
 	d, b := FastDTW(balance1, balance2, 1)
 
 
-	fmt.Println(d)
-	fmt.Println(b)
-}
+	t.Logf("\n\nd: %f\nb: %d", d, b)
+
+}

+ 2 - 2
internal/pkg/gss/gss_test.go

@@ -13,7 +13,7 @@ func TestGss(t *testing.T) {
 	}
 	}
 	logger := log.New(os.Stdout, "", 0)
 	logger := log.New(os.Stdout, "", 0)
 	a, b := Gss(f, 1, 5, 1e-4, logger)
 	a, b := Gss(f, 1, 5, 1e-4, logger)
-	println(a, b)
+	t.Logf("\n\n %f %f", a, b)
 	// 1e-6
 	// 1e-6
 	// Output:
 	// Output:
 	// 0	        1	        5
 	// 0	        1	        5
@@ -51,5 +51,5 @@ func TestGss(t *testing.T) {
 	// 32	        2	        2
 	// 32	        2	        2
 
 
 	a, b = Gss(f, 0.9, 1.1, 1e-4, logger)
 	a, b = Gss(f, 0.9, 1.1, 1e-4, logger)
-	println(a, b)
+	t.Logf("\n\n %f %f", a, b)
 }
 }

+ 1 - 1
internal/pkg/imdb_helper/imdb_test.go

@@ -16,7 +16,7 @@ func TestGetVideoInfoFromIMDB(t *testing.T) {
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)
 	}
 	}
-	println(imdbInfo.Name, imdbInfo.Year, imdbInfo.ID)
+	t.Logf("\n\n Name:  %s\tYear:  %d\tID:  %s", imdbInfo.Name, imdbInfo.Year, imdbInfo.ID)
 }
 }
 
 
 func TestIsChineseVideo(t *testing.T) {
 func TestIsChineseVideo(t *testing.T) {