diff --git a/gin_test.go b/gin_test.go index fc9e821..8657d1a 100644 --- a/gin_test.go +++ b/gin_test.go @@ -8,6 +8,7 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin/render" "github.com/stretchr/testify/assert" ) @@ -27,6 +28,25 @@ func TestCreateEngine(t *testing.T) { assert.Empty(t, router.Handlers) } +func TestLoadHTMLDebugMode(t *testing.T) { + router := New() + SetMode(DebugMode) + router.LoadHTMLGlob("*") + r := router.HTMLRender.(render.HTMLDebug) + assert.Empty(t, r.Files) + assert.Equal(t, r.Glob, "*") + + router.LoadHTMLFiles("index.html", "login.html") + r = router.HTMLRender.(render.HTMLDebug) + assert.Empty(t, r.Glob) + assert.Equal(t, r.Files, []string{"index.html", "login.html"}) + SetMode(TestMode) +} + +func TestLoadHTMLReleaseMode(t *testing.T) { + +} + func TestAddRoute(t *testing.T) { router := New() router.addRoute("GET", "/", HandlersChain{func(_ *Context) {}})