-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* remove trimws for workspace names with leading space, closes #86 - no effect for trailing spaces * isolate .avworkspaces_clean and test
- Loading branch information
Showing
2 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,3 +116,28 @@ test_that(".avbucket_path() trims arguments correctly", { | |
.avbucket_path("gs://foo", "bar", c("baz", "bing")) | ||
) | ||
}) | ||
|
||
test_that(".av_workspaces_clean() preserves leading and trailing spaces", { | ||
## add intentional spaces in workspace.name | ||
testws <- tibble::tibble( | ||
workspace.name = " a test workspace ", | ||
workspace.lastModified = "2023-06-26T21:17:26.343Z", | ||
workspace.createdBy = "[email protected]", | ||
workspace.namespace = "bioconductor-rpci-anvil", | ||
accessLevel = "READER", | ||
extraCol = TRUE | ||
) | ||
restbl <- testws | ||
## for testing names | ||
coi <- c("name", "lastModified", "createdBy", "namespace", "accessLevel") | ||
names(restbl) <- coi | ||
## for testing select operation | ||
restbl <- restbl[, coi] | ||
## for testing Date coercion | ||
restbl[["lastModified"]] <- as.Date(restbl[["lastModified"]]) | ||
|
||
expect_identical( | ||
.avworkspaces_clean(testws), | ||
restbl | ||
) | ||
}) |