test: add resilience and recovery evidence

This commit is contained in:
2026-09-24 10:15:17 +03:00
parent 25722c5f60
commit 57673f3e38
12 changed files with 1195 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package main
import (
"strings"
"testing"
)
func TestRunRequiresAddress(t *testing.T) {
tests := []struct {
name string
host string
port string
want string
}{
{name: "missing host", port: "8080", want: "APP_HOST is required"},
{name: "missing port", host: "127.0.0.1", want: "APP_PORT is required"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Setenv("APP_HOST", tt.host)
t.Setenv("APP_PORT", tt.port)
if err := run(nil); err == nil || !strings.Contains(err.Error(), tt.want) {
t.Fatalf("run() error = %v, want %q", err, tt.want)
}
})
}
}