Skip to content
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

Draft: Increase code coverage #253

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/testthat/test-search_files.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
test_that("search_files function", {
expect_true(exists("search_files")) # Exists in workspace
expect_error(search_catalogues()) # Raises error without specifying keyword arguments
expect_error(search_files(TRUE, TRUE, TRUE)) # Returns an error with incorrect argument types

# Test case 1: Search for "GM1" in "labour-force-australia" catalogue
expected_output_1 <- c("GM1.xlsx", 'GM1_Historical.xlsx')
actual_output_1 <- search_files("GM1", "labour-force-australia")
expect_equal(actual_output_1, expected_output_1)

# Test case 2: Search for "XYZ" in "labour-force-australia" catalogue
expected_output_3 <- character(0)
actual_output_3 <- search_files("XYZ", "labour-force-australia")
expect_equal(actual_output_3, expected_output_3)
})
Loading