key: add test for recursive values (#130)
Unknwon
6 years ago
31 | 31 |
|
32 | 32 |
// Maximum allowed depth when recursively substituing variable names.
|
33 | 33 |
_DEPTH_VALUES = 99
|
34 | |
_VERSION = "1.31.0"
|
|
34 |
_VERSION = "1.31.1"
|
35 | 35 |
)
|
36 | 36 |
|
37 | 37 |
// Version returns current package version literal.
|
477 | 477 |
So(k.Value(), ShouldEqual, "ini.v1")
|
478 | 478 |
})
|
479 | 479 |
}
|
|
480 |
|
|
481 |
func TestRecursiveValues(t *testing.T) {
|
|
482 |
Convey("Recursive values should not reflect on same key", t, func() {
|
|
483 |
f, err := ini.Load([]byte(`
|
|
484 |
NAME = ini
|
|
485 |
[package]
|
|
486 |
NAME = %(NAME)s`))
|
|
487 |
So(err, ShouldBeNil)
|
|
488 |
So(f, ShouldNotBeNil)
|
|
489 |
So(f.Section("package").Key("NAME").String(), ShouldEqual, "ini")
|
|
490 |
})
|
|
491 |
}
|