mirror of
https://github.com/typesense/typesense.git
synced 2025-05-17 12:12:35 +08:00
Add test for alter with bad field type.
This commit is contained in:
parent
284c3d0dc7
commit
3e08b7d556
@ -465,6 +465,17 @@ TEST_F(CollectionSchemaChangeTest, AlterValidations) {
|
||||
ASSERT_FALSE(alter_op.ok());
|
||||
ASSERT_EQ("Only `fields` can be updated at the moment.",alter_op.error());
|
||||
|
||||
// 9. bad datatype in alter
|
||||
schema_changes = R"({
|
||||
"fields": [
|
||||
{"name": "title", "drop": true},
|
||||
{"name": "title", "type": "foobar"}
|
||||
]
|
||||
})"_json;
|
||||
alter_op = coll1->alter(schema_changes);
|
||||
ASSERT_FALSE(alter_op.ok());
|
||||
ASSERT_EQ("Field `title` has an invalid data type `foobar`, see docs for supported data types.",alter_op.error());
|
||||
|
||||
collectionManager.drop_collection("coll1");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user