add tests for checkpoint config merging

This commit is contained in:
Mitchell Hashimoto 2016-11-23 09:34:05 -08:00
parent fc4af62156
commit 20a979c36b
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 38 additions and 0 deletions

View File

@ -66,3 +66,41 @@ func TestConfig_Merge(t *testing.T) {
t.Fatalf("bad: %#v", actual) t.Fatalf("bad: %#v", actual)
} }
} }
func TestConfig_Merge_disableCheckpoint(t *testing.T) {
c1 := &Config{
DisableCheckpoint: true,
}
c2 := &Config{}
expected := &Config{
Providers: map[string]string{},
Provisioners: map[string]string{},
DisableCheckpoint: true,
}
actual := c1.Merge(c2)
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("bad: %#v", actual)
}
}
func TestConfig_Merge_disableCheckpointSignature(t *testing.T) {
c1 := &Config{
DisableCheckpointSignature: true,
}
c2 := &Config{}
expected := &Config{
Providers: map[string]string{},
Provisioners: map[string]string{},
DisableCheckpointSignature: true,
}
actual := c1.Merge(c2)
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("bad: %#v", actual)
}
}