diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-27 22:36:50 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-27 22:42:16 +0200 |
commit | 2dd4cf35aab8324608a83d337459fd8354521b92 (patch) | |
tree | b65ecc803260bc268332fb2fbce83ab5dd209dbc /pkg/config/config_test.go | |
parent | 60e8e751c76d949a28eefe0c5462e0cf17337217 (diff) | |
download | cerrado-2dd4cf35aab8324608a83d337459fd8354521b92.tar.gz cerrado-2dd4cf35aab8324608a83d337459fd8354521b92.tar.bz2 cerrado-2dd4cf35aab8324608a83d337459fd8354521b92.zip |
feat: Wraps handler into its own package
Although this creates more complex folder structure will allow in the
feature for a easier testing of those given handlers.
Diffstat (limited to 'pkg/config/config_test.go')
-rw-r--r-- | pkg/config/config_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index c8cd887..7afbaef 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -8,17 +8,17 @@ import ( "github.com/google/go-cmp/cmp" ) -func TestConfig(t *testing.T) { +func TestFileParsing(t *testing.T) { testCases := []struct { name string config string - expectedConfig *Configuration + expectedConfig *configuration }{ { name: "minimal scan", config: `scan "/srv/git"`, - expectedConfig: &Configuration{ - Scan: &Scan{ + expectedConfig: &configuration{ + Scan: &scan{ Public: true, Path: "/srv/git", }, @@ -29,8 +29,8 @@ func TestConfig(t *testing.T) { config: `scan "/srv/git" { public false }`, - expectedConfig: &Configuration{ - Scan: &Scan{ + expectedConfig: &configuration{ + Scan: &scan{ Public: false, Path: "/srv/git", }, @@ -41,7 +41,7 @@ func TestConfig(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { r := strings.NewReader(tc.config) - config, err := Parse(r) + config, err := parse(r) if err != nil { t.Fatalf("Error parsing config %s", err.Error()) } |