Use native configuration validation and diagnostics
This commit is contained in:
@@ -40,11 +40,11 @@ inputs:
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "session.yml must be concrete") {
|
||||
t.Fatalf("error = %q, want concrete session guidance", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "session.yml must be concrete") {
|
||||
t.Fatalf("error = %q, want concrete session guidance", configurationErrorText(err))
|
||||
}
|
||||
if !strings.Contains(err.Error(), "run narratio session init") {
|
||||
t.Fatalf("error = %q, want session init guidance", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "run narratio session init") {
|
||||
t.Fatalf("error = %q, want session init guidance", configurationErrorText(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ func TestPlanFailsWhenSessionIDMismatchesConcreteSession(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "session_id mismatch") {
|
||||
t.Fatalf("error = %q, want mismatch context", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "session_id mismatch") {
|
||||
t.Fatalf("error = %q, want mismatch context", configurationErrorText(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ inputs:
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "previous_session_id mismatch") {
|
||||
t.Fatalf("error = %q, want mismatch context", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "previous_session_id mismatch") {
|
||||
t.Fatalf("error = %q, want mismatch context", configurationErrorText(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ func TestPlanRequiresExpectedPreviousSessionID(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "previous_session_id is required") {
|
||||
t.Fatalf("error = %q, want missing previous-session expectation", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "previous_session_id is required") {
|
||||
t.Fatalf("error = %q, want missing previous-session expectation", configurationErrorText(err))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ func TestResolveSessionConfigPathErrorIncludesSearchedPaths(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Fatal("expected error, got nil")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "searched") {
|
||||
t.Fatalf("error = %q, want searched paths", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "searched") {
|
||||
t.Fatalf("error = %q, want searched paths", configurationErrorText(err))
|
||||
}
|
||||
if !strings.Contains(err.Error(), "pass --session") {
|
||||
t.Fatalf("error = %q, want explicit-session guidance", err.Error())
|
||||
if !strings.Contains(configurationErrorText(err), "pass --session") {
|
||||
t.Fatalf("error = %q, want explicit-session guidance", configurationErrorText(err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user