forked from mtusi2026/mtusi2026lab3
Prepare verified laboratory 3 implementation and evidence
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
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")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user