Skip to content

Commit

Permalink
Name regexp argument (easier to search)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdesmet committed Dec 26, 2023
1 parent 180d6d1 commit 0c68c2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/testthat/test-check_path.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ test_that("check_path() returns error on absolute path when safe = TRUE", {
)
expect_error(
frictionless:::check_path("/dir/file.txt", safe = TRUE),
"`path` must be a safe path.",
regexp = "`path` must be a safe path.",
fixed = TRUE
)
expect_error(
frictionless:::check_path("/dir/file.txt", safe = TRUE),
"'/dir/file.txt' is an absolute path starting with \"/\" which is unsafe.",
regexp = "'/dir/file.txt' is an absolute path starting with \"/\" which is unsafe.",
fixed = TRUE
)
})
Expand All @@ -40,12 +40,12 @@ test_that("check_path() returns error on relative parent path when safe = TRUE",
)
expect_error(
check_path("../dir/file.txt", safe = TRUE),
"`path` must be a safe path.",
regexp = "`path` must be a safe path.",
fixed = TRUE
)
expect_error(
check_path("../dir/file.txt", safe = TRUE),
"'../dir/file.txt' is a relative parent path starting with \"../\" which is unsafe.",
regexp = "'../dir/file.txt' is a relative parent path starting with \"../\" which is unsafe.",
fixed = TRUE
)
})
Expand All @@ -57,7 +57,7 @@ test_that("check_path() returns error when local file cannot be found", {
)
expect_error(
check_path("no_such_file.csv"),
"Can't find file at 'no_such_file.csv'.",
regexp = "Can't find file at 'no_such_file.csv'.",
fixed = TRUE
)
})
Expand All @@ -69,7 +69,7 @@ test_that("check_path() returns error when remote file cannot be found", {
)
expect_error(
check_path("http://example.com/no_such_file.csv"),
"Can't find file at <http://example.com/no_such_file.csv>.",
regexp = "Can't find file at <http://example.com/no_such_file.csv>.",
fixed = TRUE
)
})

0 comments on commit 0c68c2e

Please sign in to comment.