-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests@208 support for newline@main #746
Conversation
…oche/rtables into add_tests@208_support_for_newline@main
Thanks @Melkiades for the change, blocking this PR after the release |
# We want topleft alignment that goes to the bottom! | ||
tl <- c(rep("", nli - lentl), tl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important imo @shajoezhu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the align bottom of top_left
Code Coverage Summary
Diff against main
Results for commit: de4806a Minimum allowed coverage is ♻️ This comment has been updated with latest results |
spans <- spans[-whsnc, , drop = FALSE] | ||
body <- body[-whsnc, , drop = FALSE] | ||
mpf_aligns <- mpf_aligns[-whsnc, , drop = FALSE] | ||
row_to_pop <- whsnc - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this exported was changed because now the extra line to pop is above and not below (top_left is bottom aligned)
@@ -147,7 +147,7 @@ test_that("newline in column names and possibly cell values work", { | |||
expect_identical(mf_nlheader(matform2), | |||
4L) | |||
expect_identical(matform2$strings[1:4, 1, drop = TRUE], | |||
c("Ethnicity", " Factor2", "", "")) | |||
c("", "", "Ethnicity", " Factor2")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now It is bottom aligned
analyze("BMRKR1", na_str = "asd\nasd") %>% # \n error | ||
build_table(DM_trick) | ||
|
||
top_left(tbl) <- c("\na", "b\nd\n\n", "c\n\n") # last \n is eaten up, if in the middle error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first \n are kept ->> note that if you want a blank line you could even do "\n " as group of spaces are considered words now
@Melkiades one case I have identified where the topleft bottom-up insertion isn't working for me: lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM") %>%
analyze("AGE") %>%
append_topleft("Age")
build_table(lyt, rawdat2)
This works only if the lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM", labels_var = "arm_label") %>%
analyze("AGE") %>%
append_topleft("Age")
build_table(lyt, rawdat2)
I'm not sure if this is an issue with the topleft insertion or because of the newlines in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! merge to allow downstream UAT
for me the first does not work
|
Fixes insightsengineering/tlg-catalog#48