Files
Agent-System/internal/docgov/null_if_zero_test.go
T
weichenandCursor c2efcdbacd fix(docgov): map zero duty ids to NULL on CreateOrGetDocument
Optional reviewer/approver duties leave UserID=0; writing 0 into
document_records FK columns failed with SQLSTATE 23503. Align create
path with docduty nullIfZero and surface ensureUser failures in logs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 06:08:35 +00:00

17 lines
352 B
Go

package docgov
import "testing"
func TestNullIfZero(t *testing.T) {
t.Parallel()
if got := nullIfZero(0); got != nil {
t.Fatalf("nullIfZero(0)=%v want nil", got)
}
if got := nullIfZero(-1); got != nil {
t.Fatalf("nullIfZero(-1)=%v want nil", got)
}
if got := nullIfZero(9); got != int64(9) {
t.Fatalf("nullIfZero(9)=%v want 9", got)
}
}