From 211409bb11ef47c8b15c087fe41d8ed39f838c7a Mon Sep 17 00:00:00 2001 From: Pavlo Date: Wed, 12 Apr 2023 22:10:11 +0300 Subject: [PATCH] 1839 dummy function --- R/my_first_fcn.R | 23 +++++++++++++++++++++++ R/test-my_first_fcn.R | 13 +++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 R/my_first_fcn.R create mode 100644 R/test-my_first_fcn.R diff --git a/R/my_first_fcn.R b/R/my_first_fcn.R new file mode 100644 index 0000000000..f9fe36d5c0 --- /dev/null +++ b/R/my_first_fcn.R @@ -0,0 +1,23 @@ +#' Derive Extension Example #' +#' Says hello admiral +#' +#' @param hw TRUE or FALSE +#' +#' @author Open Source +#' @details Something Something +#' +#' @return Happy Message +#' +#' @family der_adxx +#' @keywords der_adxx +#' @export +#' @examples +#' hello_admiral(hw = FALSE) +#' +hello_admiral <- function (hw = TRUE) { + if (hw) { + message ("Welcome to the admiral family!") } + else { + message ("Welcome to the admiral family!") + } +} diff --git a/R/test-my_first_fcn.R b/R/test-my_first_fcn.R new file mode 100644 index 0000000000..007c237943 --- /dev/null +++ b/R/test-my_first_fcn.R @@ -0,0 +1,13 @@ +test_that ("hello admiral greets without hw", { + expect_message( + hello_admiral(), + "^Welcome to the admiral family!\\n" + ) +}) + +test_that ("hello admiral greets with hw", { + expect_message( + hello_admiral(TRUE), + "^Welcome to the admiral family!\\n" + ) +})