Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshil Goel committed Mar 14, 2024
1 parent 057f3d3 commit f23bd97
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions query/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,16 +590,16 @@ var binaryFunctions = map[string]binaryFunc{
// In fact, if one of the arguments is a vector then the other *must* be
// a scalar!
var mixedScalarVectOps = map[string]struct{}{
"*": struct{}{},
"/": struct{}{},
"*": {},
"/": {},
}

var opsAllowingVectorsOnRight = map[string]struct{}{
"u-": struct{}{},
"+": struct{}{},
"-": struct{}{},
"*": struct{}{},
"dot": struct{}{},
"u-": {},
"+": {},
"-": {},
"*": {},
"dot": {},
}

type valType int
Expand Down
2 changes: 1 addition & 1 deletion types/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func ParseVFloat(s string) ([]float32, error) {
if len(trimmed) == 0 {
return []float32{}, nil
}
if strings.Index(trimmed, ",") != -1 {
if strings.Contains(trimmed, ",") {
// Splitting based on comma-separation.
values := strings.Split(trimmed, ",")
result := make([]float32, len(values))
Expand Down
2 changes: 1 addition & 1 deletion types/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestConversionEdgeCases(t *testing.T) {
}{
{in: Val{Tid: BinaryID},
out: Val{Tid: BinaryID},
failure: "Invalid data to convert to binary"},
failure: "invalid data to convert to binary"},

// From BinaryID to X
{in: Val{Tid: BinaryID, Value: []byte{}},
Expand Down
8 changes: 4 additions & 4 deletions types/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ func TestTypeForValue(t *testing.T) {

func TestFloatArrayTranslation(t *testing.T) {
testCases := [][]float32{
[]float32{},
[]float32{0.1},
[]float32{0},
[]float32{0.65433, 1.855, 3.1415926539},
{},
{0.1},
{0},
{0.65433, 1.855, 3.1415926539},
}
for _, tc := range testCases {
asBytes := FloatArrayAsBytes(tc)
Expand Down

0 comments on commit f23bd97

Please sign in to comment.