<commit_before>package openapi_test

import (
	"testing"

	openapi "github.com/nasa9084/go-openapi"
)

func TestValidateStatusCode(t *testing.T) {
	candidates := []struct {
		label  string
		in     string
		hasErr bool
	}{
		{"empty", "", true},
		{"default", "default", false},
		{"200", "200", false},
		{"tooLow", "99", true},
		{"tooHigh", "600", true},
		{"wildcard", "2XX", false},<commit_msg>add test for responses.Validate()<commit_after>package openapi_test

import (
	"testing"

	openapi "github.com/nasa9084/go-openapi"
)

func TestResponsesValidate(t *testing.T) {
	validResp := &openapi.Response{Description: "foobar"}
	candidates := []candidate{
		{"empty", openapi.Responses{}, false},
		{"hasInvalidStatus", openapi.Responses{"foobar": validResp}, true},
		{"hasDefaultStatus", openapi.Responses{"default": validResp}, false},
		{"hasWildcardStatus", openapi.Responses{"2XX": validResp}, false},
		{"hasOKStatus", openapi.Responses{"200": validResp}, false},
		{"hasEmptyResponse", openapi.Responses{"200": &openapi.Response{}}, true},
	}
	testValidater(t, candidates)
}

func TestValidateStatusCode(t *testing.T) {
	candidates := []struct {
		label  string
		in     string
		hasErr bool
	}{
		{"empty", "", true},
		{"default", "default", false},
		{"200", "200", false},
		{"tooLow", "99", true},
		{"tooHigh", "600", true},
		{"wildcard", "2XX", false},
{'fraction_non_alphanumeric': 0.1924198250728863, 'fraction_numerical': 0.028425655976676383, 'mean_word_length': 5.269406392694064, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3695371', 'n_tokens_mistral': 541, 'n_tokens_neox': 485, 'n_words': 103}