mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Add testcase.
This commit is contained in:
@@ -18,4 +18,21 @@ class StringUtilSpec extends Specification {
|
||||
}
|
||||
}
|
||||
|
||||
"escapeHtml" should {
|
||||
"escape &, <, > and \"" in {
|
||||
StringUtil.escapeHtml("<a href=\"/test\">a & b</a>") mustEqual "<a href="/test">a & b</a>"
|
||||
}
|
||||
}
|
||||
|
||||
"md5" should {
|
||||
"generate MD5 hash" in {
|
||||
StringUtil.md5("abc") mustEqual "900150983cd24fb0d6963f7d28e17f72"
|
||||
}
|
||||
}
|
||||
|
||||
"sha1" should {
|
||||
"generate SHA1 hash" in {
|
||||
StringUtil.sha1("abc") mustEqual "a9993e364706816aba3e25717850c26c9cd0d89d"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user