diff --git a/R/read_log_file.R b/R/read_log_file.R index a7c1c4d..95e5c4a 100644 --- a/R/read_log_file.R +++ b/R/read_log_file.R @@ -160,7 +160,8 @@ parse_log <- function(nested_log) { tidyr::separate(".", sep = "\\: ", into = c("Variable", "Value"), - extra = "merge" + extra = "merge", + fill = "right" ) } @@ -186,6 +187,7 @@ parse_log <- function(nested_log) { sep = "\\s", into = c("setting", "value"), extra = "merge", + fill = "right" ) %>% dplyr::mutate(dplyr::across(tidyselect::where(is.character), stringr::str_trim)) @@ -218,6 +220,7 @@ parse_log <- function(nested_log) { sep = "\\s", into = c("setting", "value"), extra = "merge", + fill = "right" ) %>% dplyr::mutate(dplyr::across(tidyselect::where(is.character), stringr::str_trim)) } diff --git a/tests/testthat/test-parse.R b/tests/testthat/test-parse.R index 6a33b42..8d10c9f 100644 --- a/tests/testthat/test-parse.R +++ b/tests/testthat/test-parse.R @@ -13,7 +13,7 @@ test_that("read_log_file will parse a logrx log file and create the necessary ob # check that the log file can be parsed parsedFile <- read_log_file(filePath) -'' + expect_length(parsedFile, 9) expect_named( parsedFile,