mirror of
https://github.com/go-ini/ini.git
synced 2026-06-19 21:46:45 +02:00
key: add test for recursive values (#130)
This commit is contained in:
@@ -32,7 +32,7 @@ const (
|
||||
|
||||
// Maximum allowed depth when recursively substituing variable names.
|
||||
_DEPTH_VALUES = 99
|
||||
_VERSION = "1.31.0"
|
||||
_VERSION = "1.31.1"
|
||||
)
|
||||
|
||||
// Version returns current package version literal.
|
||||
|
||||
+12
@@ -478,3 +478,15 @@ func TestKey_SetValue(t *testing.T) {
|
||||
So(k.Value(), ShouldEqual, "ini.v1")
|
||||
})
|
||||
}
|
||||
|
||||
func TestRecursiveValues(t *testing.T) {
|
||||
Convey("Recursive values should not reflect on same key", t, func() {
|
||||
f, err := ini.Load([]byte(`
|
||||
NAME = ini
|
||||
[package]
|
||||
NAME = %(NAME)s`))
|
||||
So(err, ShouldBeNil)
|
||||
So(f, ShouldNotBeNil)
|
||||
So(f.Section("package").Key("NAME").String(), ShouldEqual, "ini")
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user