1
0

admin_test.go 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package beego
  2. import (
  3. "fmt"
  4. "testing"
  5. )
  6. func TestList_01(t *testing.T) {
  7. m := make(map[string]interface{})
  8. list("BConfig", BConfig, m)
  9. t.Log(m)
  10. om := oldMap()
  11. for k, v := range om {
  12. if fmt.Sprint(m[k]) != fmt.Sprint(v) {
  13. t.Log(k, "old-key", v, "new-key", m[k])
  14. t.FailNow()
  15. }
  16. }
  17. }
  18. func oldMap() map[string]interface{} {
  19. m := make(map[string]interface{})
  20. m["BConfig.AppName"] = BConfig.AppName
  21. m["BConfig.RunMode"] = BConfig.RunMode
  22. m["BConfig.RouterCaseSensitive"] = BConfig.RouterCaseSensitive
  23. m["BConfig.ServerName"] = BConfig.ServerName
  24. m["BConfig.RecoverPanic"] = BConfig.RecoverPanic
  25. m["BConfig.CopyRequestBody"] = BConfig.CopyRequestBody
  26. m["BConfig.EnableGzip"] = BConfig.EnableGzip
  27. m["BConfig.MaxMemory"] = BConfig.MaxMemory
  28. m["BConfig.EnableErrorsShow"] = BConfig.EnableErrorsShow
  29. m["BConfig.Listen.Graceful"] = BConfig.Listen.Graceful
  30. m["BConfig.Listen.ServerTimeOut"] = BConfig.Listen.ServerTimeOut
  31. m["BConfig.Listen.ListenTCP4"] = BConfig.Listen.ListenTCP4
  32. m["BConfig.Listen.EnableHTTP"] = BConfig.Listen.EnableHTTP
  33. m["BConfig.Listen.HTTPAddr"] = BConfig.Listen.HTTPAddr
  34. m["BConfig.Listen.HTTPPort"] = BConfig.Listen.HTTPPort
  35. m["BConfig.Listen.EnableHTTPS"] = BConfig.Listen.EnableHTTPS
  36. m["BConfig.Listen.HTTPSAddr"] = BConfig.Listen.HTTPSAddr
  37. m["BConfig.Listen.HTTPSPort"] = BConfig.Listen.HTTPSPort
  38. m["BConfig.Listen.HTTPSCertFile"] = BConfig.Listen.HTTPSCertFile
  39. m["BConfig.Listen.HTTPSKeyFile"] = BConfig.Listen.HTTPSKeyFile
  40. m["BConfig.Listen.EnableAdmin"] = BConfig.Listen.EnableAdmin
  41. m["BConfig.Listen.AdminAddr"] = BConfig.Listen.AdminAddr
  42. m["BConfig.Listen.AdminPort"] = BConfig.Listen.AdminPort
  43. m["BConfig.Listen.EnableFcgi"] = BConfig.Listen.EnableFcgi
  44. m["BConfig.Listen.EnableStdIo"] = BConfig.Listen.EnableStdIo
  45. m["BConfig.WebConfig.AutoRender"] = BConfig.WebConfig.AutoRender
  46. m["BConfig.WebConfig.EnableDocs"] = BConfig.WebConfig.EnableDocs
  47. m["BConfig.WebConfig.FlashName"] = BConfig.WebConfig.FlashName
  48. m["BConfig.WebConfig.FlashSeparator"] = BConfig.WebConfig.FlashSeparator
  49. m["BConfig.WebConfig.DirectoryIndex"] = BConfig.WebConfig.DirectoryIndex
  50. m["BConfig.WebConfig.StaticDir"] = BConfig.WebConfig.StaticDir
  51. m["BConfig.WebConfig.StaticExtensionsToGzip"] = BConfig.WebConfig.StaticExtensionsToGzip
  52. m["BConfig.WebConfig.TemplateLeft"] = BConfig.WebConfig.TemplateLeft
  53. m["BConfig.WebConfig.TemplateRight"] = BConfig.WebConfig.TemplateRight
  54. m["BConfig.WebConfig.ViewsPath"] = BConfig.WebConfig.ViewsPath
  55. m["BConfig.WebConfig.EnableXSRF"] = BConfig.WebConfig.EnableXSRF
  56. m["BConfig.WebConfig.XSRFExpire"] = BConfig.WebConfig.XSRFExpire
  57. m["BConfig.WebConfig.Session.SessionOn"] = BConfig.WebConfig.Session.SessionOn
  58. m["BConfig.WebConfig.Session.SessionProvider"] = BConfig.WebConfig.Session.SessionProvider
  59. m["BConfig.WebConfig.Session.SessionName"] = BConfig.WebConfig.Session.SessionName
  60. m["BConfig.WebConfig.Session.SessionGCMaxLifetime"] = BConfig.WebConfig.Session.SessionGCMaxLifetime
  61. m["BConfig.WebConfig.Session.SessionProviderConfig"] = BConfig.WebConfig.Session.SessionProviderConfig
  62. m["BConfig.WebConfig.Session.SessionCookieLifeTime"] = BConfig.WebConfig.Session.SessionCookieLifeTime
  63. m["BConfig.WebConfig.Session.SessionAutoSetCookie"] = BConfig.WebConfig.Session.SessionAutoSetCookie
  64. m["BConfig.WebConfig.Session.SessionDomain"] = BConfig.WebConfig.Session.SessionDomain
  65. m["BConfig.WebConfig.Session.SessionDisableHTTPOnly"] = BConfig.WebConfig.Session.SessionDisableHTTPOnly
  66. m["BConfig.Log.AccessLogs"] = BConfig.Log.AccessLogs
  67. m["BConfig.Log.FileLineNum"] = BConfig.Log.FileLineNum
  68. m["BConfig.Log.Outputs"] = BConfig.Log.Outputs
  69. return m
  70. }