Codebase list golang-github-go-ini-ini / 7e7da45
key: add test for recursive values (#130) Unknwon 6 years ago
2 changed file(s) with 13 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
3131
3232 // Maximum allowed depth when recursively substituing variable names.
3333 _DEPTH_VALUES = 99
34 _VERSION = "1.31.0"
34 _VERSION = "1.31.1"
3535 )
3636
3737 // Version returns current package version literal.
477477 So(k.Value(), ShouldEqual, "ini.v1")
478478 })
479479 }
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 }