Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MIRACUM
misc
DIZtools
Commits
0819da6c
Commit
0819da6c
authored
3 years ago
by
Lorenz Kapsner
Browse files
Options
Download
Email Patches
Plain Diff
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/testthat.R
+2
-2
tests/testthat.R
tests/testthat/test-lints.R
+1
-1
tests/testthat/test-lints.R
tests/testthat/test-log.R
+44
-0
tests/testthat/test-log.R
with
47 additions
and
3 deletions
+47
-3
tests/testthat.R
+
2
-
2
View file @
0819da6c
library
(
testthat
)
library
(
DIZ
uti
ls
)
library
(
DIZ
too
ls
)
test_check
(
"DIZ
uti
ls"
)
test_check
(
"DIZ
too
ls"
)
This diff is collapsed.
Click to expand it.
tests/testthat/test-lints.R
+
1
-
1
View file @
0819da6c
context
(
"lints"
)
if
(
dir.exists
(
"../../00_pkg_src"
))
{
prefix
<-
"../../00_pkg_src/DIZ
uti
ls/"
prefix
<-
"../../00_pkg_src/DIZ
too
ls/"
}
else
if
(
dir.exists
(
"../../R"
))
{
prefix
<-
"../../"
}
else
if
(
dir.exists
(
"./R"
))
{
...
...
This diff is collapsed.
Click to expand it.
tests/testthat/test-log.R
0 → 100644
+
44
-
0
View file @
0819da6c
# 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
))
)
})
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help