From 73a0636bec92fd00b55934f66ffc338a094f3bb8 Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Mon, 2 Dec 2024 15:09:41 +0000 Subject: [PATCH] #1839 Fix bugs --- R/my_first_fcn.R | 7 ++++++- man/my_first_fcn.Rd | 15 +++++++++++++++ tests/testthat/test-my_first_fcn.R | 6 ++---- 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 man/my_first_fcn.Rd diff --git a/R/my_first_fcn.R b/R/my_first_fcn.R index 4e469439a8..0abfb14e03 100644 --- a/R/my_first_fcn.R +++ b/R/my_first_fcn.R @@ -1,3 +1,8 @@ -my_first_fcn <- function(hw = TRUE) { +#' Send welcoming message to the user +#' +#' @details +#' This is a function that prints a welcoming message to the terminal that +#' greets the user. +my_first_fcn <- function() { "Welcome to the admiral family!" } diff --git a/man/my_first_fcn.Rd b/man/my_first_fcn.Rd new file mode 100644 index 0000000000..abb0bf2688 --- /dev/null +++ b/man/my_first_fcn.Rd @@ -0,0 +1,15 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/my_first_fcn.R +\name{my_first_fcn} +\alias{my_first_fcn} +\title{Send welcoming message to the user} +\usage{ +my_first_fcn() +} +\description{ +Send welcoming message to the user +} +\details{ +This is a function that prints a welcoming message to the terminal that +greets the user. +} diff --git a/tests/testthat/test-my_first_fcn.R b/tests/testthat/test-my_first_fcn.R index 91f1013bf2..d7e730a20f 100644 --- a/tests/testthat/test-my_first_fcn.R +++ b/tests/testthat/test-my_first_fcn.R @@ -1,8 +1,6 @@ -## Test 1: Veryfying the message function works fine and prints out the message ---- -test_that("multiplication works", { +## Test 1: Verifying the message function works fine and prints out the message ---- +test_that("Message printing works", { expected_output <- "Welcome to the admiral family!" - actual_output <- my_first_fcn() - expect_equal(expected_output, actual_output) })