Limit scope of TestHostname
@@ -69,8 +69,7 @@ func TestHostname(t *testing.T) {
r := strings.NewReader(hostnameConfig)
c, err := readConfig(r)
assert.Nil(t, err, "Should parsed valid config file: %s", hostnameConfig)
- assert.Equal(t, c, Config{Hostname: "foo", ReadBufferSizeBytes: defaultBufferSizeBytes},
- "Should have parsed hostname into Config")
+ assert.Equal(t, c.Hostname, "foo", "Should have parsed hostname into Config")
const noHostname = "hostname: ''"
r = strings.NewReader(noHostname)
@@ -78,17 +77,13 @@ func TestHostname(t *testing.T) {
assert.Nil(t, err, "Should parsed valid config file: %s", noHostname)
currentHost, err := os.Hostname()
assert.Nil(t, err, "Could not get current hostname")
- assert.Equal(t, c, Config{Hostname: currentHost, ReadBufferSizeBytes: defaultBufferSizeBytes},
- "Should have used current hostname in Config")
+ assert.Equal(t, c.Hostname, currentHost, "Should have used current hostname in Config")
const omitHostname = "omit_empty_hostname: true"
r = strings.NewReader(omitHostname)
c, err = readConfig(r)
assert.Nil(t, err, "Should parsed valid config file: %s", omitHostname)
- assert.Equal(t, c, Config{
- Hostname: "",
- ReadBufferSizeBytes: defaultBufferSizeBytes,
- OmitEmptyHostname: true})
+ assert.Equal(t, c.Hostname, "", "Should have respected omit_empty_hostname")
}
func TestVeneurExamples(t *testing.T) {
