You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
793 B
27 lines
793 B
package iceberg
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestValidateCreateTableRequestRejectsStageCreate(t *testing.T) {
|
|
err := validateCreateTableRequest(CreateTableRequest{Name: "orders", StageCreate: true})
|
|
if !errors.Is(err, errStageCreateUnsupported) {
|
|
t.Fatalf("validateCreateTableRequest() error = %v, want errStageCreateUnsupported", err)
|
|
}
|
|
}
|
|
|
|
func TestValidateCreateTableRequestRequiresName(t *testing.T) {
|
|
err := validateCreateTableRequest(CreateTableRequest{})
|
|
if err == nil {
|
|
t.Fatalf("validateCreateTableRequest() expected error")
|
|
}
|
|
}
|
|
|
|
func TestValidateCreateTableRequestAcceptsStandardCreate(t *testing.T) {
|
|
err := validateCreateTableRequest(CreateTableRequest{Name: "orders"})
|
|
if err != nil {
|
|
t.Fatalf("validateCreateTableRequest() error = %v, want nil", err)
|
|
}
|
|
}
|