Skip to content

Commit

Permalink
Fix for data types #35
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosak01 committed Mar 4, 2024
1 parent 8e7e5ba commit bc330fc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# common 1.1.2

* Added `source.all()` function.
* Fix for data type on `subsc()` and `supsc()`.

# common 1.1.1

Expand Down
4 changes: 4 additions & 0 deletions R/subsc.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ subsc <- function(x) {
ret <- c()
val <- c()

if (!is.character(x)) {
x <- as.character(x)
}

lnms <- names(sublower)
unms <- names(subupper)

Expand Down
5 changes: 4 additions & 1 deletion R/supsc.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@
#' @export
supsc <- function(x) {


ret <- c()
val <- c()

if (!is.character(x)) {
x <- as.character(x)
}

lnms <- names(suplower)
unms <- names(supupper)

Expand Down
1 change: 1 addition & 0 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
common: common.html
last_built: 2024-03-03T22:54Z
last_built: 2024-03-04T13:41Z
urls:
reference: https://common.r-sassy.org/reference
article: https://common.r-sassy.org/articles
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test-supsub.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ test_that("super3: Superscript other characters work as expected.", {
})


test_that("super4: Non-character arguments turned to character without error.", {

ret2 <- supsc(1)

expect_equal(TRUE, TRUE)

})


test_that("sub1: Subscript lower case letters work as expected.", {
Expand Down Expand Up @@ -118,5 +125,12 @@ test_that("sub3: Subscript other characters work as expected.", {
})


test_that("sub4: Non-character arguments turned to character without error.", {

ret <- subsc(1)


expect_equal(TRUE, TRUE)

})

0 comments on commit bc330fc

Please sign in to comment.