Simple hosts file management in Go (golang).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
418 B

package goodhosts
import (
"fmt"
"testing"
)
func TestHostsLineIsComment(t *testing.T) {
comment := " # This is a comment "
line := NewHostsLine(comment)
result := IsComment(line.Raw)
if !result {
t.Error(fmt.Sprintf("'%s' should be a comment", comment))
}
}
func TestNewHostsLineWithEmptyLine(t *testing.T) {
line := NewHostsLine("")
if line.Raw != "" {
t.Error("Failed to load empty line.")
}
}