mw/federation: correct parse (#1027)
Fix parse error and add testcase when a ZONE is specified. Fixes #1024
This commit is contained in:
parent
9452a0a3bc
commit
c514197d6b
2 changed files with 19 additions and 6 deletions
|
@ -13,6 +13,7 @@ func TestSetup(t *testing.T) {
|
|||
expectedLen int
|
||||
expectedNameZone []string // contains only entry for now
|
||||
}{
|
||||
// ok
|
||||
{`federation {
|
||||
prod prod.example.org
|
||||
}`, false, 1, []string{"prod", "prod.example.org."}},
|
||||
|
@ -25,11 +26,15 @@ func TestSetup(t *testing.T) {
|
|||
staging staging.example.org
|
||||
prod prod.example.org
|
||||
}`, false, 2, []string{"staging", "staging.example.org."}},
|
||||
{`federation example.com {
|
||||
staging staging.example.org
|
||||
prod prod.example.org
|
||||
}`, false, 2, []string{"staging", "staging.example.org."}},
|
||||
// errors
|
||||
{`federation {
|
||||
}`, true, 0, []string{}},
|
||||
{`federation {
|
||||
staging
|
||||
staging
|
||||
}`, true, 0, []string{}},
|
||||
}
|
||||
for i, test := range tests {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue