mirror of
https://github.com/miekg/dns.git
synced 2025-12-16 09:11:34 +01:00
Very small cleanups
This commit is contained in:
parent
80d2db2e86
commit
dfa09b604c
@ -8,16 +8,13 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const normal string = `
|
const normal string = `
|
||||||
# This file is automatically generated.
|
# Comment
|
||||||
#
|
|
||||||
domain somedomain.com
|
domain somedomain.com
|
||||||
nameserver 10.28.10.2
|
nameserver 10.28.10.2
|
||||||
nameserver 11.28.10.1
|
nameserver 11.28.10.1
|
||||||
`
|
`
|
||||||
|
|
||||||
const missingNewline string = `
|
const missingNewline string = `
|
||||||
# This file is automatically generated.
|
|
||||||
#
|
|
||||||
domain somedomain.com
|
domain somedomain.com
|
||||||
nameserver 10.28.10.2
|
nameserver 10.28.10.2
|
||||||
nameserver 11.28.10.1` // <- NOTE: NO newline.
|
nameserver 11.28.10.1` // <- NOTE: NO newline.
|
||||||
@ -49,13 +46,10 @@ func testConfig(t *testing.T, data string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test we can read a normally formed resolv.conf.
|
|
||||||
func TestNameserver(t *testing.T) {
|
func TestNameserver(t *testing.T) {
|
||||||
testConfig(t, normal)
|
testConfig(t, normal)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't drop the last line if there is no newline before EOF.
|
|
||||||
func TestMissingFinalNewLine(t *testing.T) {
|
func TestMissingFinalNewLine(t *testing.T) {
|
||||||
testConfig(t, missingNewline)
|
testConfig(t, missingNewline)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user