Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Mido-sys committed Apr 25, 2024
1 parent c85e6aa commit 7dd2132
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,3 +544,15 @@ func Test_Render_Struct_With_ChainingFunction_InvalidFunctionCall(t *testing.T)
r.Error(err)
r.Contains(err.Error(), "'nour.GetBorn' does not have a method named 'TEST' (nour.GetBorn.TEST)")
}

func Test_Render_Function_on_Invalid_Function_Struct(t *testing.T) {
r := require.New(t)
ctx := plush.NewContext()
bender := Robot{
Avatar: Avatar("bender.jpg"),
}
ctx.Set("robot", bender)
input := `<%= robot.Avatar.URL2() %>`
_, err := plush.Render(input, ctx)
r.Error(err)
}

0 comments on commit 7dd2132

Please sign in to comment.