From fd6c7a58b65e8ececbedb21890f1a9bc4deaaa72 Mon Sep 17 00:00:00 2001 From: Jon Harmon Date: Mon, 20 May 2024 13:38:22 -0400 Subject: [PATCH] Only do complex string test with stringi. (#74) --- tests/testthat/test-stabilize_chr.R | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/testthat/test-stabilize_chr.R b/tests/testthat/test-stabilize_chr.R index 7f174aa..0d920f2 100644 --- a/tests/testthat/test-stabilize_chr.R +++ b/tests/testthat/test-stabilize_chr.R @@ -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(