1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 19:37:03 +00:00

make the macro#Parse to return a value of a Template instead of its ptr and debug logs for handlers length ignores the internal generated macro evaluator handler if it is there, so end-dev cannot be confused about the debug logs at that point

Former-commit-id: c23a3d10b43f145de575f1ea11e3dbf9bbd33a6b
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-09-29 19:59:39 +03:00
parent 4431a65a56
commit b08df3a785
6 changed files with 45 additions and 28 deletions

View File

@@ -6,7 +6,7 @@ import (
"github.com/kataras/iris/macro"
)
func TestMakeHandlerNeeds(t *testing.T) {
func TestCanMakeHandler(t *testing.T) {
tests := []struct {
src string
needsHandler bool
@@ -29,13 +29,13 @@ func TestMakeHandlerNeeds(t *testing.T) {
if err != nil {
t.Fatalf("[%d] '%s' failed to be parsed: %v", i, tt.src, err)
}
if _, got := MakeHandler(tmpl); got != tt.needsHandler {
if got := CanMakeHandler(tmpl); got != tt.needsHandler {
if tt.needsHandler {
t.Fatalf("[%d] '%s' expected to be able to generate an evaluator handler instead of a nil one", i, tt.src)
} else {
t.Fatalf("[%d] '%s' should not need an evaluator handler", i, tt.src)
}
}
}
}