cleanup and extra test
This commit is contained in:
parent
7a3af5b729
commit
9c67491aee
|
@ -554,8 +554,15 @@ func TestRfc1982(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestEmpty(t *testing.T) {
|
||||||
|
for _ = range ParseZone(strings.NewReader(""), "", "") {
|
||||||
|
t.Logf("Should be empty")
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestGenerate(t *testing.T) {
|
func TestGenerate(t *testing.T) {
|
||||||
zone := "$GENERATE 65-126 $ 1D AAAA $.64/26"
|
zone := "$GENERATE 65-126 $ 1D CNAME $.64/26"
|
||||||
to := ParseZone(strings.NewReader(zone), "miek.nl.", "")
|
to := ParseZone(strings.NewReader(zone), "miek.nl.", "")
|
||||||
for x := range to {
|
for x := range to {
|
||||||
if x.Error == nil {
|
if x.Error == nil {
|
||||||
|
|
7
zscan.go
7
zscan.go
|
@ -424,11 +424,8 @@ func parseZone(r io.Reader, origin, f string, t chan Token, include int) {
|
||||||
st = _EXPECT_OWNER_DIR
|
st = _EXPECT_OWNER_DIR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If we get here, we and the h.Rrtype is still zero, we haven't parsed anything
|
// If we get here, we and the h.Rrtype is still zero, we haven't parsed anything, this
|
||||||
// Empty zonefile is also still zone file
|
// is not an error, because an empty zone file is still a zone file.
|
||||||
// if h.Rrtype == 0 {
|
|
||||||
// t <- Token{Error: &ParseError{f, "nothing made sense", lex{}}}
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// zlexer scans the sourcefile and returns tokens on the channel c.
|
// zlexer scans the sourcefile and returns tokens on the channel c.
|
||||||
|
|
Loading…
Reference in New Issue