testthat::test_that("The function recognises numbers as strings", {
# A data frame containing two prices wrongly read as strings
df <- data.frame(
product = c('SmartWatch', 'laptop', 'monitor'),
price_USD = c('249', '517' ,319)
)
# Expected price for a USD discount of 25 %
price_manual <- (249+319+517)*0.75
testthat::expect_equal(
object = total_price(df, currency = 'USD'),
expected = price_manual
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.