Skip to content

Commit

Permalink
Only do complex string test with stringi. (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonthegeek committed May 20, 2024
1 parent ba7e94f commit fd6c7a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/testthat/test-stabilize_chr.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ test_that("stabilize_chr() checks values", {
})

test_that("stabilize_chr() works with complex url regex", {
skip_if_not_installed("stringi")
url_regex <- r"(^(?:(?:(?:https?|ftp):)?\/\/)?(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$)"
expect_snapshot(
stabilize_chr(
Expand Down

0 comments on commit fd6c7a5

Please sign in to comment.