From 5e8d80a9e9c5a169decbf4026e93c5dffefa59ad Mon Sep 17 00:00:00 2001 From: xh3b4sd Date: Wed, 27 Sep 2023 16:16:41 +0200 Subject: [PATCH] fix --- pkg/sorted/create_test.go | 10 +++++----- pkg/sorted/sorted.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/sorted/create_test.go b/pkg/sorted/create_test.go index 0688776..f9f4778 100644 --- a/pkg/sorted/create_test.go +++ b/pkg/sorted/create_test.go @@ -10,7 +10,7 @@ import ( "github.com/xh3b4sd/redigo/pkg/pool" ) -func Test_Create_Score_Input_Error(t *testing.T) { +func Test_Create_Index_Input_Error(t *testing.T) { testCases := []struct { ind []string }{ @@ -64,7 +64,7 @@ func Test_Create_Score_Input_Error(t *testing.T) { cre = mustNewCreateWithConn(con) } - err := cre.Score("ssk", "foo", 0.8, tc.ind...) + err := cre.Index("ssk", "foo", 0.8, tc.ind...) if !IsExecutionFailedError(err) { t.Fatal("expected", executionFailedError, "got", err) } @@ -72,7 +72,7 @@ func Test_Create_Score_Input_Error(t *testing.T) { } } -func Test_Create_Score_Input_Valid(t *testing.T) { +func Test_Create_Index_Input_Valid(t *testing.T) { testCases := []struct { ind []string }{ @@ -105,7 +105,7 @@ func Test_Create_Score_Input_Valid(t *testing.T) { cre = mustNewCreateWithConn(con) } - err := cre.Score("ssk", "foo", 0.8, tc.ind...) + err := cre.Index("ssk", "foo", 0.8, tc.ind...) if err != nil { t.Fatal(err) } @@ -124,7 +124,7 @@ func mustNewCreateWithConn(con redis.Conn) *create { c = &create{ pool: p, - createScoreScript: redis.NewScript(2, createScoreScript), + createIndexScript: redis.NewScript(2, createIndexScript), prefix: "prefix", } diff --git a/pkg/sorted/sorted.go b/pkg/sorted/sorted.go index 1663e25..6a816af 100644 --- a/pkg/sorted/sorted.go +++ b/pkg/sorted/sorted.go @@ -26,7 +26,7 @@ func New(config Config) (*Sorted, error) { cre = &create{ pool: config.Pool, - createScoreScript: redis.NewScript(2, createScoreScript), + createIndexScript: redis.NewScript(2, createIndexScript), prefix: config.Prefix, }