diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-11 21:19:16 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-11 21:19:16 +0200 |
commit | 98b4a72f1776d0343c0649920f031723e5ca0e47 (patch) | |
tree | 27714641861522dfe7901fb441e79e6778ff570d /pkg/config/config_test.go | |
parent | 7ff4cac4fc23060a56b9c33a3453c2d26629b699 (diff) | |
download | cerrado-98b4a72f1776d0343c0649920f031723e5ca0e47.tar.gz cerrado-98b4a72f1776d0343c0649920f031723e5ca0e47.tar.bz2 cerrado-98b4a72f1776d0343c0649920f031723e5ca0e47.zip |
feat: Fix testingv0.0.2
Diffstat (limited to 'pkg/config/config_test.go')
-rw-r--r-- | pkg/config/config_test.go | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 9109ecb..2d779c5 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -22,6 +22,7 @@ func TestFileParsing(t *testing.T) { Public: false, Path: "/srv/git", }, + ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{}, }, }, @@ -36,6 +37,7 @@ scan "/srv/git" { Public: true, Path: "/srv/git", }, + ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{}, }, }, @@ -43,7 +45,8 @@ scan "/srv/git" { name: "minimal repository", config: `repository /srv/git/cerrado.git`, expectedConfig: &configuration{ - Scan: defaultScan(), + Scan: defaultScan(), + ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{ { Name: "cerrado.git", @@ -63,7 +66,8 @@ repository /srv/git/cerrado.git { public true }`, expectedConfig: &configuration{ - Scan: defaultScan(), + Scan: defaultScan(), + ListenAddr: defaultAddr(), Repositories: []*GitRepositoryConfiguration{ { Name: "cerrado", @@ -75,8 +79,28 @@ repository /srv/git/cerrado.git { }, }, { + name: "minimal listen", + config: ``, + expectedConfig: &configuration{ + Scan: defaultScan(), + ListenAddr: defaultAddr(), + Repositories: []*GitRepositoryConfiguration{}, + }, + }, + { + name: "complete listen", + config: `listen-addr unix://var/run/cerrado/cerrado.sock`, + expectedConfig: &configuration{ + Scan: defaultScan(), + ListenAddr: "unix://var/run/cerrado/cerrado.sock", + Repositories: []*GitRepositoryConfiguration{}, + }, + }, + { name: "complete", config: ` +listen-addr unix://var/run/cerrado/cerrado.sock + scan "/srv/git" { public true } @@ -93,6 +117,7 @@ repository /srv/git/cerrado.git { Public: true, Path: "/srv/git", }, + ListenAddr: "unix://var/run/cerrado/cerrado.sock", Repositories: []*GitRepositoryConfiguration{ { Name: "linux.git", |