Skip to content

Commit

Permalink
feat: #1839 create my_first_fcn
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyukn committed Oct 19, 2024
1 parent bf9ffdd commit 8d0fbf7
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export(list_all_templates)
export(list_tte_source_objects)
export(max_cond)
export(min_cond)
export(my_first_fcn)
export(negate_vars)
export(params)
export(print_named_list)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
`AVALCATx` & `AVALCAxN`. (#2480)
- New function `derive_vars_crit_flag()` for deriving criterion flag variables
(`CRITy`, `CRITyFL`, `CRITyFLN`). (#2468)
- New function `my_first_fcn()` as dummy practice. (#1839)

- Replace use of `data("sdtm")` with `sdtm <- pharmaverse::sdtm` in templates and vignettes. (#2498)

Expand Down
16 changes: 16 additions & 0 deletions R/my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#' Print a Greeting Message
#'
#' Prints a fixed greeting `message`.
#'
#' @return No return value (`NULL`).
#'
#' @keywords other_advanced
#' @family other_advanced
#'
#' @export
#'
#' @examples
#' my_first_fcn()
my_first_fcn <- function() {
message("Welcome to the admiral family!")
}
1 change: 1 addition & 0 deletions man/list_tte_source_objects.Rd

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

24 changes: 24 additions & 0 deletions man/my_first_fcn.Rd

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

3 changes: 2 additions & 1 deletion man/params.Rd

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

10 changes: 10 additions & 0 deletions tests/testthat/test-my_first_fcn.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# my_first_fcn ----
## Test 1: returns NULL ----
test_that("my_first_fcn Test 1: returns NULL", {
expect_null(my_first_fcn())
})

## Test 2: produces a message ----
test_that("my_first_fcn Test 2: produces a message", {
expect_message(my_first_fcn(), "^Welcome to the admiral family!\\n$")
})

0 comments on commit 8d0fbf7

Please sign in to comment.