mirror of
https://github.com/astaxie/beego.git
synced 2025-07-07 02:10:17 +00:00
support section
if iniconf.String("demo.key1") != "asta" { + t.Fatal("get demo.key1 error") + } + if iniconf.String("demo.key2") != "xie" { + t.Fatal("get demo.key2 error") + }
This commit is contained in:
@ -6,6 +6,8 @@ import (
|
||||
)
|
||||
|
||||
var inicontext = `
|
||||
;comment one
|
||||
#comment two
|
||||
appname = beeapi
|
||||
httpport = 8080
|
||||
mysqlport = 3600
|
||||
@ -13,6 +15,9 @@ PI = 3.1415976
|
||||
runmode = "dev"
|
||||
autorender = false
|
||||
copyrequestbody = true
|
||||
[demo]
|
||||
key1="asta"
|
||||
key2 = "xie"
|
||||
`
|
||||
|
||||
func TestIni(t *testing.T) {
|
||||
@ -63,4 +68,10 @@ func TestIni(t *testing.T) {
|
||||
if iniconf.String("name") != "astaxie" {
|
||||
t.Fatal("get name error")
|
||||
}
|
||||
if iniconf.String("demo.key1") != "asta" {
|
||||
t.Fatal("get demo.key1 error")
|
||||
}
|
||||
if iniconf.String("demo.key2") != "xie" {
|
||||
t.Fatal("get demo.key2 error")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user