You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: config_test.go
    path of file: ./repos/skeema/internal/linter
    
    the code of the file until where you have to start completion: package linter

import (
	"reflect"
	"regexp"
	"strings"
	"testing"

	"github.com/skeema/skeema/internal/tengo"
)

func TestOptionsForDir(t *testing.T) {
	dir := getDir(t, "testdata/validcfg")
	if opts, err := OptionsForDir(dir); err != nil {
		t.Errorf("Unexpected error from OptionsForDir: %s", err)
	} else {
		expectedSeverity := make(map[string]Severity, len(rulesByName))
		for name, rule := range rulesByName {
			expectedSeverity[name] = rule.DefaultSeverity
		}
		expectedSeverity["pk"] = SeverityError             // see testdata/validcfg/.skeema
		expectedSeverity["display-width"] = SeverityIgnore // ditto
		if !reflect.DeepEqual(opts.RuleSeverity, expectedSeverity) {
			t.Errorf("RuleSeverity is %v, does not match expectation %v", opts.RuleSeverity, expectedSeverity)
		}

		expectedAllowList := map[string]string{
			"charset":  "utf8mb4",
			"engine":   "innodb, myisam",
			"auto-inc": "int unsigned, bigint unsigned",
		}
		for ruleName, expected := range expectedAllowList {
			actual := strings.Join(opts.AllowList(ruleName), ", ")
			if actual != expected {
				t.Errorf("AllowList(%q) returned %q, expected %q", ruleName, actual, expected)
			}
		}

		expectedDefinerConfig := &definerConfig{
			allowedDefinersString: "'root'@'%', procbot@127.0.0.1",
			allowedDefinersMatch: []*regexp.Regexp{
				regexp.MustCompile(`^root@.*$`),
				regexp.MustCompile(`^procbot@127\.0\.0\.1$`),
			},
		}
		actualDefinerConfig := opts.RuleConfig["definer"].(*definerConfig)
		if !reflect.DeepEqual(*expectedDefinerConfig, *actualDefinerConfig) {
			t.Errorf("definerConfig did not match expectation")
		}

		// no flavor defined in dir's .skeema
		if opts.Flavor != tengo.FlavorUnknown {
			t.Errorf("Flavor did not match expectation: expected %s, found %s", tengo.FlavorUnknown, opts.Flavor)
		}
	}

	// Coverage for error conditions
	badOptions := []string{
		"--errors=made-up-problem",
		"--warnings='bad-charset,made-up-problem,bad-engine'",
		"--lint-engine=ignore --warnings=bad-engine",
		"--allow-charset=''",
		"--allow-engine=''
    
func TestOptionsForDir(t *testing.T) {
	dir := getDir(t, "testdata/validcfg")
	if opts, err := OptionsForDir(dir); err != nil {
		t.Errorf("Unexpected error from OptionsForDir: %s", err)
	} else {
		expectedSeverity := make(map[string]Severity, len(rulesByName))
		for name, rule := range rulesByName {
			expectedSeverity[name] = rule.DefaultSeverity
		}
		expectedSeverity["pk"] = SeverityError             // see testdata/validcfg/.skeema
		expectedSeverity["display-width"] = SeverityIgnore // ditto
		if !reflect.DeepEqual(opts.RuleSeverity, expectedSeverity) {
			t.Errorf("RuleSeverity is %v, does not match expectation %v", opts.RuleSeverity, expectedSeverity)
		}

		expectedAllowList := map[string]string{
			"charset":  "utf8mb4",
			"engine":   "innodb, myisam",
			"auto-inc": "int unsigned, bigint unsigned",
		}
		for ruleName, expected := range expectedAllowList {
			actual := strings.Join(opts.AllowList(ruleName), ", ")
			if actual != expected {
				t.Errorf("AllowList(%q) returned %q, expected %q", ruleName, actual, expected)
			}
		}

		expectedDefinerConfig := &definerConfig{
			allowedDefinersString: "'root'@'%', procbot@127.0.0.1",
			allowedDefinersMatch: []*regexp.Regexp{
				regexp.MustCompile(`^root@.*$`),
				regexp.MustCompile(`^procbot@127\.0\.0\.1$`),
			},
		}
		actualDefinerConfig := opts.RuleConfig["definer"].(*definerConfig)
		if !reflect.DeepEqual(*expectedDefinerConfig, *actualDefinerConfig) {
			t.Errorf("definerConfig did not match expectation")
		}

		// no flavor defined in dir's .skeema
		if opts.Flavor != tengo.FlavorUnknown {
			t.Errorf("Flavor did not match expectation: expected %s, found %s", tengo.FlavorUnknown, opts.Flavor)
		}
	}

	// Coverage for error conditions
	badOptions := []string{
		"--errors=made-up-problem",
		"--warnings='bad-charset,made-up-problem,bad-engine'",
		"--lint-engine=ignore --warnings=bad-engine",
		"--allow-charset=''",
		"--allow-engine=''",
		"--lint-engine=gentle-nudge",
		"--allow-definer=''",
	}
	confirmError := func(cliArgs string) {
		t.Helper()
		dir := getDir(t, "testdata/validcfg", cliArgs)
		if _, err := OptionsForDir(dir); err == nil {
			t.Errorf("Expected an error from OptionsForDir with CLI %s, but it was nil", cliArgs)
		} else if _, ok := err.(ConfigError); !ok {
			t.Errorf("Expected error to be a ConfigError, but instead type is %T", err)
		}
	}
	for _, badOpt := range badOptions {
		confirmError(badOpt)
	}

	// Confirm ConfigError implements Error interface and works as expected
	var err error
	err = NewConfigError(dir, "testing ConfigError")
	if err.Error() != "testing ConfigError" {
		t.Errorf("ConfigError not behaving as expected")
	}
}