mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 14:01:55 +02:00
(v0.7.1.9091) percentage from clean pkg
This commit is contained in:
@ -21,16 +21,6 @@
|
||||
|
||||
context("misc.R")
|
||||
|
||||
test_that("percentages works", {
|
||||
expect_equal(percent(0.25), "25%")
|
||||
expect_equal(percent(0.5), "50%")
|
||||
expect_equal(percent(0.500, force_zero = TRUE), "50.0%")
|
||||
expect_equal(percent(0.1234), "12.3%")
|
||||
# round up 0.5
|
||||
expect_equal(percent(0.0054), "0.5%")
|
||||
expect_equal(percent(0.0055), "0.6%")
|
||||
})
|
||||
|
||||
test_that("functions missing in older R versions work", {
|
||||
expect_equal(strrep("A", 5), "AAAAA")
|
||||
expect_equal(strrep(c("A", "B"), c(5, 2)), c("AAAAA", "BB"))
|
||||
|
Reference in New Issue
Block a user