Skip to content

Commit

Permalink
Add test cases for array field type (#616)
Browse files Browse the repository at this point in the history
Signed-off-by: ThreadDao <[email protected]>
  • Loading branch information
ThreadDao authored Nov 10, 2023
1 parent c7e62d0 commit b61b0b6
Show file tree
Hide file tree
Showing 12 changed files with 1,079 additions and 296 deletions.
10 changes: 6 additions & 4 deletions test/common/response_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ func EqualColumn(t *testing.T, columnA entity.Column, columnB entity.Column) {
require.ElementsMatch(t, columnA.(*entity.ColumnFloatVector).Data(), columnB.(*entity.ColumnFloatVector).Data())
case entity.FieldTypeBinaryVector:
require.ElementsMatch(t, columnA.(*entity.ColumnBinaryVector).Data(), columnB.(*entity.ColumnBinaryVector).Data())
case entity.FieldTypeArray:
log.Println("TODO support column element type")
default:
log.Printf("The column type not in: [%v, %v, %v, %v, %v, %v, %v, %v, %v, %v, %v]",
log.Printf("The column type not in: [%v, %v, %v, %v, %v, %v, %v, %v, %v, %v, %v, %v]",
entity.FieldTypeBool, entity.FieldTypeInt8, entity.FieldTypeInt16, entity.FieldTypeInt32,
entity.FieldTypeInt64, entity.FieldTypeFloat, entity.FieldTypeDouble, entity.FieldTypeString,
entity.FieldTypeVarChar, entity.FieldTypeFloatVector, entity.FieldTypeBinaryVector)
entity.FieldTypeVarChar, entity.FieldTypeArray, entity.FieldTypeFloatVector, entity.FieldTypeBinaryVector)

}
}
Expand All @@ -173,10 +175,10 @@ func CheckQueryResult(t *testing.T, actualColumns []entity.Column, expColumns []
func CheckOutputFields(t *testing.T, actualColumns []entity.Column, expFields []string) {
actualFields := make([]string, 0)
for _, actualColumn := range actualColumns {
log.Printf("column name: %s, column type: %s, column fieldData: %v",
actualColumn.Name(), actualColumn.Type(), actualColumn.FieldData())
actualFields = append(actualFields, actualColumn.Name())
}
log.Printf("actual fields: %v", actualFields)
log.Printf("expected fields: %v", expFields)
require.ElementsMatchf(t, expFields, actualFields, fmt.Sprintf("Expected search output fields: %v, actual: %v", expFields, actualFields))
}

Expand Down
Loading

0 comments on commit b61b0b6

Please sign in to comment.