Fix ConfNested on Windows (#851)

This commit is contained in:
Egon Elbre 2018-12-13 16:34:38 +02:00 committed by JT Olio
parent 969fcabf72
commit 08394389d3

View File

@ -6,6 +6,7 @@ package cfgstruct
import ( import (
"flag" "flag"
"fmt" "fmt"
"path/filepath"
"reflect" "reflect"
"testing" "testing"
"time" "time"
@ -105,6 +106,6 @@ func TestNesting(t *testing.T) {
} }
Bind(f, &c, ConfDirNested("confpath")) Bind(f, &c, ConfDirNested("confpath"))
assertEqual(f.Lookup("string").DefValue, "-confpath+") assertEqual(f.Lookup("string").DefValue, "-confpath+")
assertEqual(f.Lookup("my-struct1.string").DefValue, "1confpath/my-struct12") assertEqual(f.Lookup("my-struct1.string").DefValue, filepath.FromSlash("1confpath/my-struct12"))
assertEqual(f.Lookup("my-struct1.my-struct2.string").DefValue, "2confpath/my-struct1/my-struct23") assertEqual(f.Lookup("my-struct1.my-struct2.string").DefValue, filepath.FromSlash("2confpath/my-struct1/my-struct23"))
} }