diff --git a/main.go b/main.go new file mode 100644 index 0000000..081abb2 --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +import "log" + +func main() { + log.Println("Hello World") +} diff --git a/pki/domain/dockerCompose/config_test.go b/pki/domain/dockerCompose/config_test.go index 2374a29..c7ae2a8 100644 --- a/pki/domain/dockerCompose/config_test.go +++ b/pki/domain/dockerCompose/config_test.go @@ -75,6 +75,47 @@ func TestNetwork_Equal(t *testing.T) { } } +func TestNetworkIPAM_Equal(t *testing.T) { + require := require.New(t) + + testCases := []struct { + equalableA dockerCompose.Equalable + equalableB dockerCompose.Equalable + expectedResult bool + }{ + { + equalableA: &dockerCompose.NetworkIPAM{}, + equalableB: &dockerCompose.Service{}, + expectedResult: false, + }, + { + equalableA: &dockerCompose.NetworkIPAM{}, + equalableB: nil, + expectedResult: false, + }, + { + equalableA: &dockerCompose.NetworkIPAM{ + Configs: make([]*dockerCompose.NetworkIPAMConfig, 0), + }, + equalableB: &dockerCompose.NetworkIPAM{}, + expectedResult: false, + }, + { + equalableA: &dockerCompose.NetworkIPAM{ + Configs: make([]*dockerCompose.NetworkIPAMConfig, 0), + }, + equalableB: &dockerCompose.NetworkIPAM{ + Configs: make([]*dockerCompose.NetworkIPAMConfig, 0), + }, + expectedResult: true, + }, + } + + for i, testCase := range testCases { + require.Equal(testCase.expectedResult, testCase.equalableA.Equal(testCase.equalableB), "Failed test case %v", i) + } +} + func TestServiceDeployResourcesLimits_Equal(t *testing.T) { require := require.New(t)