Centralize output schema names in schema package
This commit is contained in:
@@ -5,6 +5,43 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValidOutputSchemaName(t *testing.T) {
|
||||
valid := []string{
|
||||
OutputSchemaMinimal,
|
||||
OutputSchemaIntermediate,
|
||||
OutputSchemaFull,
|
||||
}
|
||||
for _, name := range valid {
|
||||
if !ValidOutputSchemaName(name) {
|
||||
t.Fatalf("expected %q to be valid", name)
|
||||
}
|
||||
}
|
||||
|
||||
invalid := []string{"", "compact", "minimal", "seriatim"}
|
||||
for _, name := range invalid {
|
||||
if ValidOutputSchemaName(name) {
|
||||
t.Fatalf("expected %q to be invalid", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestOutputSchemaNames(t *testing.T) {
|
||||
names := OutputSchemaNames()
|
||||
want := []string{
|
||||
OutputSchemaMinimal,
|
||||
OutputSchemaIntermediate,
|
||||
OutputSchemaFull,
|
||||
}
|
||||
if len(names) != len(want) {
|
||||
t.Fatalf("len(names) = %d, want %d", len(names), len(want))
|
||||
}
|
||||
for index := range want {
|
||||
if names[index] != want[index] {
|
||||
t.Fatalf("names[%d] = %q, want %q", index, names[index], want[index])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateTranscriptAcceptsValidTranscript(t *testing.T) {
|
||||
transcript := validTranscript()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user