mirror of
https://github.com/go-ini/ini.git
synced 2026-06-19 21:46:45 +02:00
struct_test: fix test cases for Go 1.10
Added Go 1.10 to CI.
This commit is contained in:
@@ -6,6 +6,7 @@ go:
|
||||
- 1.7.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
|
||||
script:
|
||||
- go get golang.org/x/tools/cmd/cover
|
||||
|
||||
+5
-5
@@ -37,7 +37,7 @@ type testNested struct {
|
||||
Unused int `ini:"-"`
|
||||
}
|
||||
|
||||
type testEmbeded struct {
|
||||
type TestEmbeded struct {
|
||||
GPA float64
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ type testStruct struct {
|
||||
Born time.Time
|
||||
Time time.Duration `ini:"Duration"`
|
||||
Others testNested
|
||||
*testEmbeded `ini:"grade"`
|
||||
*TestEmbeded `ini:"grade"`
|
||||
Unused int `ini:"-"`
|
||||
Unsigned uint
|
||||
Omitted bool `ini:"omitthis,omitempty"`
|
||||
@@ -97,12 +97,12 @@ type unsupport2 struct {
|
||||
}
|
||||
}
|
||||
|
||||
type unsupport3 struct {
|
||||
type Unsupport3 struct {
|
||||
Cities byte
|
||||
}
|
||||
|
||||
type unsupport4 struct {
|
||||
*unsupport3 `ini:"Others"`
|
||||
*Unsupport3 `ini:"Others"`
|
||||
}
|
||||
|
||||
type defaultValue struct {
|
||||
@@ -155,7 +155,7 @@ func Test_MapToStruct(t *testing.T) {
|
||||
So(fmt.Sprint(ts.Others.Populations), ShouldEqual, "[12345678 98765432]")
|
||||
So(fmt.Sprint(ts.Others.Coordinates), ShouldEqual, "[192.168 10.11]")
|
||||
So(ts.Others.Note, ShouldEqual, "Hello world!")
|
||||
So(ts.testEmbeded.GPA, ShouldEqual, 2.8)
|
||||
So(ts.TestEmbeded.GPA, ShouldEqual, 2.8)
|
||||
})
|
||||
|
||||
Convey("Map section to struct", func() {
|
||||
|
||||
Reference in New Issue
Block a user