package middleware

import "testing"

func TestRecordPanicRecovered(t *testing.T) {
	start := GetPanicRecoveredCount()
	RecordPanicRecovered()
	got := GetPanicRecoveredCount()
	if got != start+1 {
		t.Fatalf("want %d got %d", start+1, got)
	}
}

func TestGetHTTP5xxCount_NoneYet(t *testing.T) {
	n := GetHTTP5xxCount()
	if n < 0 {
		t.Fatalf("unexpected error value %d", n)
	}
}

func TestGetHTTPRequestsTotalCount_SafeWhenEmpty(t *testing.T) {
	n := GetHTTPRequestsTotalCount()
	if n < 0 {
		t.Fatalf("unexpected error value %d", n)
	}
}
