mirror of
https://github.com/notherealmarco/coredns-deployment.git
synced 2025-05-05 20:42:33 +02:00
parent
626e32c427
commit
5fe683c057
2 changed files with 66 additions and 2 deletions
|
@ -241,7 +241,6 @@ stubzone.org:53 {
|
|||
}
|
||||
`}
|
||||
|
||||
|
||||
for _, d := range defaultCorefiles {
|
||||
if !Default("", d) {
|
||||
t.Errorf("expected config to be identified as a default: %v", d)
|
||||
|
@ -253,3 +252,28 @@ stubzone.org:53 {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateVersions(t *testing.T) {
|
||||
testCases := []struct {
|
||||
from string
|
||||
to string
|
||||
shouldErr bool
|
||||
}{
|
||||
{"1.3.1", "1.5.0", false},
|
||||
{"1.5.0", "1.3.1", true},
|
||||
{"banana", "1.5.0", true},
|
||||
{"1.3.1", "apple", true},
|
||||
{"banana", "apple", true},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
err := validateVersions(tc.from, tc.to)
|
||||
|
||||
if !tc.shouldErr && err != nil {
|
||||
t.Errorf("expected '%v' to '%v' to be valid versions.", tc.from, tc.to)
|
||||
}
|
||||
if tc.shouldErr && err == nil {
|
||||
t.Errorf("expected '%v' to '%v' to be invalid versions.", tc.from, tc.to)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue