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:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user