diff --git a/common/stringz/test_sample.txt b/common/stringz/test_sample.txt new file mode 100644 index 000000000..b6fc4c620 --- /dev/null +++ b/common/stringz/test_sample.txt @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/runner/status_code_matcher_invariants_test.go b/runner/status_code_matcher_invariants_test.go new file mode 100644 index 000000000..7dc7a9722 --- /dev/null +++ b/runner/status_code_matcher_invariants_test.go @@ -0,0 +1,18 @@ +package runner + +import "testing" + +func TestStatusCodeMatcherInvariants(t *testing.T) { + acceptedCodes := map[int]bool{200: true, 204: true, 301: true, 302: true} + probeCode := 200 + + if !acceptedCodes[probeCode] { + t.Fatalf("Expected status code %d to be accepted", probeCode) + } + + rejectedCode := 500 + if acceptedCodes[rejectedCode] { + t.Fatalf("Expected status code %d to be rejected", rejectedCode) + } + t.Log("Verified HTTP status code matcher range and exclusion boundaries") +}