Cleaned up and added more tests.

This commit is contained in:
Erik C. Thauvin 2021-07-30 01:26:52 -07:00
parent af9546e3d1
commit 04e88264cd
9 changed files with 76 additions and 17 deletions

View file

@ -106,7 +106,7 @@ object Utils {
*/
@JvmStatic
fun colorize(s: String?, color: String): String {
return if (s.isNullOrEmpty()) {
return if (s.isNullOrBlank()) {
Colors.NORMAL
} else if (Colors.BOLD == color || Colors.REVERSE == color) {
color + s + color

View file

@ -198,8 +198,8 @@ class StockQuote(bot: Mobibot) : ThreadedModule(bot) {
data.forEach {
add(
NoticeMessage(
"${it.first}:".padEnd(pad).prependIndent(),
unescapeXml(quote.getString(it.second))
"${it.first}:".padEnd(pad).prependIndent()
+ unescapeXml(quote.getString(it.second))
)
)
}

View file

@ -72,4 +72,8 @@ open class Message {
this.isError = isError
this.isPrivate = isPrivate
}
override fun toString(): String {
return "Message(color='$color', isError=$isError, isNotice=$isNotice, isPrivate=$isPrivate, msg='$msg')"
}
}