Skip to content

Commit

Permalink
[add] increased coverage on SerializeIndexingOptions and IndexDefinit…
Browse files Browse the repository at this point in the history
…ion_Serialize
  • Loading branch information
filipecosta90 committed Aug 9, 2020
1 parent 4b79274 commit 08e9562
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions redisearch/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestIndexDefinition_Serialize(t *testing.T) {
want redis.Args
}{
{"default", fields{NewIndexDefinition()}, args{redis.Args{}}, redis.Args{"ON", "HASH"}},
{"default+async", fields{NewIndexDefinition().SetAsync(true)}, args{redis.Args{}}, redis.Args{"ON", "HASH", "ASYNC"}},
{"default+score", fields{NewIndexDefinition().SetScore(0.75)}, args{redis.Args{}}, redis.Args{"ON", "HASH", "SCORE", 0.75}},
{"default+score_field", fields{NewIndexDefinition().SetScoreField("myscore")}, args{redis.Args{}}, redis.Args{"ON", "HASH", "SCORE_FIELD", "myscore"}},
{"default+language", fields{NewIndexDefinition().SetLanguage("portuguese")}, args{redis.Args{}}, redis.Args{"ON", "HASH", "LANGUAGE", "portuguese"}},
Expand Down
1 change: 1 addition & 0 deletions redisearch/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func Test_serializeIndexingOptions(t *testing.T) {
}{
{"default with args", args{DefaultIndexingOptions, redis.Args{"idx1", "doc1", 1.0}}, redis.Args{"idx1", "doc1", 1.0}},
{"default", args{DefaultIndexingOptions, redis.Args{}}, redis.Args{}},
{"default + language", args{IndexingOptions{Language: "portuguese"}, redis.Args{}}, redis.Args{"LANGUAGE", "portuguese"}},
{"replace full doc", args{IndexingOptions{Replace: true}, redis.Args{}}, redis.Args{"REPLACE"}},
{"replace partial", args{IndexingOptions{Replace: true, Partial: true}, redis.Args{}}, redis.Args{"REPLACE", "PARTIAL"}},
{"replace if", args{IndexingOptions{Replace: true, ReplaceCondition: "@timestamp < 23323234234"}, redis.Args{}}, redis.Args{"REPLACE", "IF", "@timestamp < 23323234234"}},
Expand Down

0 comments on commit 08e9562

Please sign in to comment.