Improve D&D validation reliability
This commit is contained in:
@@ -21,7 +21,7 @@ func TestValidatorContractAndRegistration(t *testing.T) {
|
||||
if _, err := DecodeOptions(map[string]any{"unexpected": true}); err == nil || !strings.Contains(err.Error(), "unknown option") {
|
||||
t.Fatalf("DecodeOptions() error = %v, want unknown option error", err)
|
||||
}
|
||||
if got := New(Options{}).CheckpointFingerprints(); len(got) != 1 || got[0].Name != "policy" || got[0].Value != policy {
|
||||
if got := New(Options{}).CheckpointFingerprints(); len(got) != 2 || got[0].Name != "policy" || got[0].Value != policy || got[1].Name != "correction_policy" || got[1].Value != correctionPolicy {
|
||||
t.Fatalf("fingerprints = %#v, want identity policy", got)
|
||||
}
|
||||
|
||||
@@ -65,6 +65,9 @@ func TestValidatorDefersShapeAndRejectsIdentityIssues(t *testing.T) {
|
||||
t.Fatalf("identity message %q missing %q", result.Message, want)
|
||||
}
|
||||
}
|
||||
if !strings.Contains(result.CorrectionGuidance, "duplicate-group proposals") || !strings.Contains(result.CorrectionGuidance, value.NPCs[0].Name) || strings.Contains(result.CorrectionGuidance, value.NPCs[0].ID) || strings.Contains(result.CorrectionGuidance, "npcs[") {
|
||||
t.Fatalf("CorrectionGuidance = %q, want contextual proposal guidance without IDs or operator paths", result.CorrectionGuidance)
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidatorBoundsUnicodeDiagnostics(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user