Updated dependencies and added avct/uasurfer (#8089)
* Updated dependencies and added avct/uasurfer * Added uasurfer to NOTICE.txt
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f5c8a71698
Коммит
2fa7c464f0
43
vendor/github.com/go-ini/ini/key_test.go
сгенерированный
поставляемый
43
vendor/github.com/go-ini/ini/key_test.go
сгенерированный
поставляемый
@@ -15,6 +15,7 @@
|
||||
package ini_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -478,3 +479,45 @@ func TestKey_SetValue(t *testing.T) {
|
||||
So(k.Value(), ShouldEqual, "ini.v1")
|
||||
})
|
||||
}
|
||||
|
||||
func TestKey_NestedValues(t *testing.T) {
|
||||
Convey("Read and write nested values", t, func() {
|
||||
f, err := ini.LoadSources(ini.LoadOptions{
|
||||
AllowNestedValues: true,
|
||||
}, []byte(`
|
||||
aws_access_key_id = foo
|
||||
aws_secret_access_key = bar
|
||||
region = us-west-2
|
||||
s3 =
|
||||
max_concurrent_requests=10
|
||||
max_queue_size=1000`))
|
||||
So(err, ShouldBeNil)
|
||||
So(f, ShouldNotBeNil)
|
||||
|
||||
So(f.Section("").Key("s3").NestedValues(), ShouldResemble, []string{"max_concurrent_requests=10", "max_queue_size=1000"})
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = f.WriteTo(&buf)
|
||||
So(err, ShouldBeNil)
|
||||
So(buf.String(), ShouldEqual, `aws_access_key_id = foo
|
||||
aws_secret_access_key = bar
|
||||
region = us-west-2
|
||||
s3 =
|
||||
max_concurrent_requests=10
|
||||
max_queue_size=1000
|
||||
|
||||
`)
|
||||
})
|
||||
}
|
||||
|
||||
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")
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user