forked from mtusi2026/mtusi2026lab3
14 lines
336 B
Go
14 lines
336 B
Go
package model
|
|
|
|
import "testing"
|
|
|
|
func TestRejectsNULInPersistedText(t *testing.T) {
|
|
for _, field := range []string{"display_name", "title", "text"} {
|
|
t.Run(field, func(t *testing.T) {
|
|
if err := requireText(field, "a\x00b", 1, 4000); err == nil {
|
|
t.Fatal("PostgreSQL text must reject NUL as a validation error")
|
|
}
|
|
})
|
|
}
|
|
}
|