WIP on v1
This commit is contained in:
@@ -17,12 +17,15 @@ editor = vim
|
||||
distance=13.42
|
||||
floats=0.5,2.37,6
|
||||
floatswithstring = 0.5, hello, 0.9
|
||||
no missedme
|
||||
false
|
||||
color`)
|
||||
|
||||
func TestPackage(t *testing.T) {
|
||||
r := bytes.NewReader(testConf)
|
||||
c := parseReader(r)
|
||||
c, err := parseReader(r)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := c.Get("floatswithstring").Float64Slice(); err == nil {
|
||||
t.Log("Float64Slice accepting incorrect values")
|
||||
t.Fail()
|
||||
@@ -99,7 +102,7 @@ func TestPackage(t *testing.T) {
|
||||
t.Log("empty string erroneously converts to float")
|
||||
t.Fail()
|
||||
}
|
||||
if def := c.GetDefault("non-existant-key", "myvalue"); def.Value != "myvalue" {
|
||||
if def := c.GetDefault("non-existant-key", "myvalue"); def.String() != "myvalue" {
|
||||
t.Log("GetDefault fails to apply default value")
|
||||
t.Fail()
|
||||
}
|
||||
|
Reference in New Issue
Block a user