R Under development (unstable) (2026-02-01 r89366 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > # Base R Regression Tests for placematchr > # Ensures critical functionality without dependencies > > library(placematchr) > > message("Running Base R Tests...") Running Base R Tests... > > # 1. Normalization: German > # ----------------------- > # Basic > stopifnot(normalize_city("München", "DE") == "muenchen") > # Exonym > stopifnot(normalize_city("Munich", "DE") == "muenchen") > stopifnot(normalize_city("Cologne", "DE") == "koeln") > # Suburbs (Garching b. München) > # "b." -> "bei " -> suffix strip -> "garching" > stopifnot(normalize_city("Garching b. München", "DE") == "garching") > > # 2. Normalization: France > # ------------------------ > # Suburb > stopifnot(normalize_city("Champs-sur-Marne", "FR") == "champs") > # Exonym > stopifnot(normalize_city("Dunkirk", "FR") == "dunkerque") > > # 3. Normalization: Spain > # ----------------------- > # Inversion: "Rozas de Madrid, Las" -> "Las Rozas de Madrid" -> "sevilla" (No, Rozas) > # "Las Rozas" -> "rozas" (Input) > # Ref inversion check logic is inside 'normalize', but works on strings. > # "Rozas de Madrid, Las" -> "las rozas de madrid" -> strip articles -> "rozas madrid" > stopifnot(grepl("rozas", normalize_city("Rozas de Madrid, Las", "ES"))) > > # 4. Matching (Integration) > # ------------------------- > # Valid match > res <- match_city("Munich", country="DE") > if (!match_city("Munich", "DE")$city_clean %in% c("muenchen")) { + stop("Failed to match Munich to muenchen") + } > > message("All Base R Tests Passed!") All Base R Tests Passed! > > proc.time() user system elapsed 0.54 0.07 0.62