19 lines
504 B
Go
19 lines
504 B
Go
package drama
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestValidateEpisodeContent(t *testing.T) {
|
|
if err := ValidateEpisodeContent(strings.Repeat("字", MaxEpisodeCharacters)); err != nil {
|
|
t.Fatalf("expected content at limit to pass: %v", err)
|
|
}
|
|
if err := ValidateEpisodeContent(strings.Repeat("字", MaxEpisodeCharacters+1)); err == nil {
|
|
t.Fatal("expected over-limit content to fail")
|
|
}
|
|
if err := ValidateEpisodeContent(" \n\t"); err == nil {
|
|
t.Fatal("expected blank content to fail")
|
|
}
|
|
}
|