Commit 0819da6c authored by Lorenz Kapsner's avatar Lorenz Kapsner
Browse files

test: moved unit tests for logging to diztools

parent d201fd95
No related merge requests found
Pipeline #36039 failed with stages
in 4 minutes and 40 seconds
Showing with 47 additions and 3 deletions
+47 -3
library(testthat)
library(DIZutils)
library(DIZtools)
test_check("DIZutils")
test_check("DIZtools")
context("lints")
if (dir.exists("../../00_pkg_src")) {
prefix <- "../../00_pkg_src/DIZutils/"
prefix <- "../../00_pkg_src/DIZtools/"
} else if (dir.exists("../../R")) {
prefix <- "../../"
} else if (dir.exists("./R")) {
......
# DIZutils - Utilities for 'DIZ' R Package Development
# Copyright (C) 2020-2022 Universitätsklinikum Erlangen, Germany
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
context("log")
test_that("correct functioning of log functions", {
log_dir <- tempdir()
expect_length(list.files(log_dir), 0)
cleanup_old_logfile(log_dir)
feedback(
print_this = "This is a first message.",
logfile_dir = log_dir
)
feedback(
print_this = "This is a second message.",
logfile_dir = log_dir
)
cleanup_old_logfile(log_dir)
expect_length(list.files(log_dir), 2)
do.call(
file.remove,
list(list.files(tempdir(), pattern = "log$", full.names = TRUE))
)
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment