mirror of
https://github.com/astaxie/beego.git
synced 2025-07-12 18:51:02 +00:00
add compare_not/not_nil methods for template
This commit is contained in:
@ -72,7 +72,7 @@ func TestDate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompare(t *testing.T) {
|
||||
func TestCompareRelated(t *testing.T) {
|
||||
if !Compare("abc", "abc") {
|
||||
t.Error("should be equal")
|
||||
}
|
||||
@ -82,6 +82,15 @@ func TestCompare(t *testing.T) {
|
||||
if !Compare("1", 1) {
|
||||
t.Error("should be equal")
|
||||
}
|
||||
if CompareNot("abc", "abc") {
|
||||
t.Error("should be equal")
|
||||
}
|
||||
if !CompareNot("abc", "aBc") {
|
||||
t.Error("should be not equal")
|
||||
}
|
||||
if !NotNil("a string") {
|
||||
t.Error("should not be nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHtmlquote(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user