Fixed uptime months calculation
This commit is contained in:
parent
a2646ceb9f
commit
b6e1888e70
12 changed files with 32 additions and 24 deletions
|
@ -77,7 +77,7 @@ class Info(private val tell: Tell, private val seen: Seen) : AbstractCommand() {
|
|||
append(years).append(" year".plural(years)).append(' ')
|
||||
}
|
||||
if (months > 0) {
|
||||
append(weeks).append(" month".plural(months)).append(' ')
|
||||
append(months).append(" month".plural(months)).append(' ')
|
||||
}
|
||||
if (weeks > 0) {
|
||||
append(weeks).append(" week".plural(weeks)).append(' ')
|
||||
|
|
|
@ -49,7 +49,6 @@ class WolframAlpha : ThreadedModule() {
|
|||
override val name = "WolframAlpha"
|
||||
|
||||
private fun getUnits(unit: String?): String {
|
||||
println("--> $unit")
|
||||
return if (unit?.lowercase() == METRIC) {
|
||||
METRIC
|
||||
} else {
|
||||
|
|
|
@ -43,7 +43,7 @@ class InfoTest {
|
|||
assertThat(
|
||||
547800300076L.toUptime(),
|
||||
"upTime(full)"
|
||||
).isEqualTo("17 years 2 months 2 weeks 1 day 6 hours 45 minutes")
|
||||
).isEqualTo("17 years 4 months 2 weeks 1 day 6 hours 45 minutes")
|
||||
assertThat(24300000L.toUptime(), "upTime(hours minutes)").isEqualTo("6 hours 45 minutes")
|
||||
assertThat(110700000L.toUptime(), "upTime(days hours minutes)").isEqualTo("1 day 6 hours 45 minutes")
|
||||
assertThat(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue