Output convertion result as is
This commit is contained in:
parent
8e03eda655
commit
0aa2136fec
3 changed files with 8 additions and 4 deletions
|
@ -147,7 +147,7 @@ class CurrencyConverter : ThreadedModule() {
|
||||||
|
|
||||||
if (json.getBoolean("success")) {
|
if (json.getBoolean("success")) {
|
||||||
PublicMessage(
|
PublicMessage(
|
||||||
"${cmds[0]} ${SYMBOLS[to]} = ${json.getDouble("result")} ${SYMBOLS[from]}"
|
"${cmds[0]} ${SYMBOLS[to]} = ${json.get("result")} ${SYMBOLS[from]}"
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
ErrorMessage("Sorry, an error occurred while converting the currencies.")
|
ErrorMessage("Sorry, an error occurred while converting the currencies.")
|
||||||
|
|
|
@ -62,6 +62,10 @@ class CurrencyConverterTest {
|
||||||
convertCurrency("100 USD to EUR").msg,
|
convertCurrency("100 USD to EUR").msg,
|
||||||
"100 USD to EUR"
|
"100 USD to EUR"
|
||||||
).matches("100 United States Dollar = \\d{2,3}\\.\\d+ Euro".toRegex())
|
).matches("100 United States Dollar = \\d{2,3}\\.\\d+ Euro".toRegex())
|
||||||
|
assertThat(
|
||||||
|
convertCurrency("1 USD to BTC").msg,
|
||||||
|
"1 USD to BTC"
|
||||||
|
).matches("1 United States Dollar = 0\\.\\d+ Bitcoin".toRegex())
|
||||||
assertThat(
|
assertThat(
|
||||||
convertCurrency("100,000.00 GBP to BTC").msg,
|
convertCurrency("100,000.00 GBP to BTC").msg,
|
||||||
"100 USD to EUR"
|
"100 USD to EUR"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Mon Aug 01 10:24:43 PDT 2022
|
#Mon Aug 15 09:46:49 PDT 2022
|
||||||
version.buildmeta=339
|
version.buildmeta=343
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=8
|
version.minor=8
|
||||||
version.patch=0
|
version.patch=0
|
||||||
version.prerelease=rc
|
version.prerelease=rc
|
||||||
version.project=mobibot
|
version.project=mobibot
|
||||||
version.semver=0.8.0-rc+339
|
version.semver=0.8.0-rc+343
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue