1
0
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:
astaxie
2013-11-27 23:55:26 +08:00
parent ba5e393e99
commit 63b82c438d
2 changed files with 102 additions and 33 deletions

View File

@ -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")
}
}