SPB Git

Repository Public BSD-3-Clause

TextTests.swift 23.3 KB 432 lines swift

1// =============================================================================2//                  SP BOUCHER | SOFTWARE & RESEARCH3//             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// PROJECT METADATA7// -----------------------------------------------------------------------------8// Project          : ORIX Maps9// File             : Packages/ORIXSearch/Tests/ORIXSearchTests/TextTests.swift10// Module           : ORIXSearchTests11// Repository       : https://git.spboucher.ai/orix-maps12// Created          : 2026-11-2513// Last Modified    : 2026-11-2514//15// =============================================================================16// AUTHOR & PROFESSIONAL AFFILIATION17// =============================================================================18//19// Author           : Simon-Pierre Boucher20// Position         : Professor of Finance21// Institution      : Université du Québec en Outaouais (UQO)22// Department       : Département des sciences administratives23// Organization     : SP Boucher24//25// Website          : https://spboucher.ai26// Git              : https://git.spboucher.ai27//28// =============================================================================29// OFFICIAL CONTACT DIRECTORY30// =============================================================================31//32// General          : info@spboucher.ai33// Professional     : contact@spboucher.ai34// Direct           : simon@spboucher.ai35// Research         : research@spboucher.ai36// Development      : dev@spboucher.ai37// Support          : support@spboucher.ai38// Security/Admin   : admin@spboucher.ai39// Notifications    : notifications@spboucher.ai40//41// Preferred Contact: support@spboucher.ai42//43// =============================================================================44// COPYRIGHT & INTELLECTUAL PROPERTY45// =============================================================================46//47// Copyright (c) 202648// Simon-Pierre Boucher49//50// All rights reserved where applicable.51//52// This file is governed by the applicable project license,53// copyright notices, institutional agreements and relevant law.54//55// Unless expressly authorized by the applicable license or56// rights holder, copying, redistribution, sublicensing,57// publication and commercial exploitation are not permitted.58//59// Existing third-party rights and notices remain unaffected.60//61// =============================================================================62// CONFIDENTIALITY & SECURITY63// =============================================================================64//65// Classification   : Public66// Distribution     : Public repository; use is governed by the project license67// Security Contact : admin@spboucher.ai68//69// Access to this source does not independently grant permission70// to redistribute or disclose confidential materials.71//72// Do not embed credentials, private keys, access tokens,73// certificates or confidential personal information.74//75// =============================================================================76// LICENSE & MAINTENANCE77// =============================================================================78//79// License          : Proprietary, all rights reserved (see license file)80// License File     : LICENSE81// Maintainer       : Simon-Pierre Boucher82// Technical Contact: dev@spboucher.ai83//84// =============================================================================85// END OF SP BOUCHER SOURCE HEADER86// =============================================================================8788import Foundation89import Testing90@testable import ORIXSearch9192@Suite struct NormalizationTests {93    @Test func foldsAccentsCaseAndLigatures() {94        #expect(TextNormalizer.fold("Montréal") == "montreal")95        #expect(TextNormalizer.fold("ÎLE-D'ORLÉANS") == "ile-d'orleans")96        #expect(TextNormalizer.fold("Cœur") == "coeur")97        #expect(TextNormalizer.fold("Straße") == "strasse")98        #expect(TextNormalizer.canonicalKey("Montréal") == TextNormalizer.canonicalKey("MONTREAL"))99    }100101    @Test func tokenizesOnPunctuation() {102        #expect(TextNormalizer.rawTokens("Saint-Jean-sur-Richelieu") == ["saint", "jean", "sur", "richelieu"])103        #expect(TextNormalizer.rawTokens("L'Assomption, QC") == ["l", "assomption", "qc"])104        #expect(TextNormalizer.rawTokens("  a/b&c  ") == ["a", "b", "c"])105        #expect(TextNormalizer.rawTokens("") == [])106        #expect(TextNormalizer.rawTokens("ᐃᓄᒃᔪᐊᒃ 12") == ["ᐃᓄᒃᔪᐊᒃ", "12"])107    }108109    @Test(arguments: [110        ("av du Parc", "avenue parc"), ("Ave. du Parc", "avenue parc"), ("Avenue du Parc", "avenue parc"),111        ("boul René-Lévesque", "boulevard rene levesque"), ("Blvd Rene Levesque", "boulevard rene levesque"),112        ("ch. Sainte-Foy", "chemin st foy"), ("Chemin Ste-Foy", "chemin st foy"), ("chemin saint foy", "chemin st foy"),113        ("rte 132", "route 132"), ("Route 132", "route 132"), ("pl. d'Armes", "place armes"),114        ("Sherbrooke Street West", "sherbrooke st ouest"), ("Sherbrooke St W", "sherbrooke st ouest"),115        ("rue Sherbrooke O", "rue sherbrooke ouest"), ("Rue Sherbrooke Ouest", "rue sherbrooke ouest"),116        ("rue Ontario E", "rue ontario est"), ("boul Saint-Laurent N", "boulevard st laurent nord"), ("rue Peel S", "rue peel sud"),117        ("Mtl", "montreal"), ("Queen Mary Rd", "queen mary road"), ("Docteur-Penfield", "dr penfield"), ("Dr Penfield Drive", "dr penfield dr"),118    ])119    func expandsAbbreviations(input: String, expected: String) {120        #expect(TextNormalizer.canonicalKey(input) == expected)121    }122123    @Test func collapsesOrdinals() {124        #expect(TextNormalizer.canonicalKey("1re Avenue") == "1 avenue")125        #expect(TextNormalizer.canonicalKey("1ère Avenue") == "1 avenue")126        #expect(TextNormalizer.canonicalKey("2e Rang") == "2 rang")127        #expect(TextNormalizer.canonicalKey("42nd Street") == "42 st")128        #expect(TextNormalizer.canonicalKey("3rd Avenue") == "3 avenue")129        #expect(TextNormalizer.ordinalNumber("12") == nil)130        #expect(TextNormalizer.ordinalNumber("12a") == nil)131    }132133    @Test func mergesRoadReferences() {134        #expect(TextNormalizer.canonicalKey("A-40") == "a40")135        #expect(TextNormalizer.canonicalKey("A 40") == "a40")136        #expect(TextNormalizer.canonicalKey("a40") == "a40")137        #expect(TextNormalizer.canonicalKey("R-132") == "r132")138        #expect(TextNormalizer.canonicalKey("Autoroute 40") == "autoroute 40")139        #expect(TextNormalizer.canonicalKey("aut 40") == "autoroute 40")140        #expect(RoadReference.aliases(ref: "20;55", streetClass: .motorway) == ["A-20", "Autoroute 20", "A-55", "Autoroute 55"])141        #expect(RoadReference.aliases(ref: "132", streetClass: .primary) == ["Route 132", "R-132"])142        #expect(RoadReference.aliases(ref: nil, streetClass: .primary).isEmpty)143    }144145    @Test func dropsStopwordsUnlessNothingElse() {146        #expect(TextNormalizer.canonicalTokens("Rue de la Montagne") == ["rue", "montagne"])147        #expect(TextNormalizer.canonicalTokens("The Bay") == ["bay"])148        #expect(TextNormalizer.canonicalTokens("La La") == ["la", "la"])149        #expect(TextNormalizer.canonicalTokens("Côte-à-Baron") == ["cote", "baron"])150    }151152    @Test func queryTokensTreatLastWordAsPrefix() {153        let t = TextNormalizer.queryTokens("rue sher", lastIsPrefix: true)154        #expect(t.map(\.text) == ["rue", "sher"])155        #expect(t.map(\.isPrefix) == [false, true])156        // An abbreviation being typed is expanded when its long form does not start with it.157        #expect(TextNormalizer.queryTokens("blvd", lastIsPrefix: true) == [QueryToken("boulevard", isPrefix: true)])158        #expect(TextNormalizer.queryTokens("boul", lastIsPrefix: true) == [QueryToken("boul", isPrefix: true)])159        // "sain" may be the beginning of "saint", indexed as "st".160        let sain = TextNormalizer.queryTokens("rue sain", lastIsPrefix: true)161        #expect(sain.last?.text == "sain")162        #expect(sain.last?.alternatives.contains("st") == true)163        // A direction letter at the end of a street is a prefix in type-ahead, a direction in a submitted query.164        #expect(TextNormalizer.queryTokens("sherbrooke o", lastIsPrefix: true).last == QueryToken("o", isPrefix: true))165        #expect(TextNormalizer.queryTokens("sherbrooke w", lastIsPrefix: true).last == QueryToken("ouest"))166        #expect(TextNormalizer.queryTokens("sherbrooke o", lastIsPrefix: false).last == QueryToken("ouest"))167        // A trailing article is not a search word yet.168        #expect(TextNormalizer.queryTokens("rue de", lastIsPrefix: true).map(\.text) == ["rue"])169        #expect(TextNormalizer.queryTokens("", lastIsPrefix: true).isEmpty)170    }171172    @Test func gluedArticles() {173        #expect(TextNormalizer.gluedArticleTokens("Parc La Fontaine") == ["lafontaine"])174        #expect(TextNormalizer.gluedArticleTokens("Avenue De Lorimier") == ["delorimier"])175        #expect(TextNormalizer.gluedArticleTokens("L'Assomption") == ["lassomption"])176        #expect(TextNormalizer.gluedArticleTokens("Rue Sherbrooke").isEmpty)177        // The query side accepts the glued form of a word that follows an article.178        let q = TextNormalizer.queryTokens("la salle", lastIsPrefix: false)179        #expect(q == [QueryToken("salle", alternatives: ["lasalle"])])180    }181182    @Test func streetCoreKey() {183        #expect(TextNormalizer.streetCoreKey("Rue Sherbrooke Ouest") == "sherbrooke ouest")184        #expect(TextNormalizer.streetCoreKey("Sherbrooke Ouest") == "sherbrooke ouest")185        #expect(TextNormalizer.streetCoreKey("Queen Mary Road") == "queen mary")186        #expect(TextNormalizer.streetCoreKey("Rue Saint-Denis") == "st denis")187        #expect(TextNormalizer.streetCoreKey("Saint-Denis") == "st denis")188    }189}190191@Suite struct EditDistanceTests {192    @Test func distances() {193        #expect(EditDistance.bounded("sherbroke", "sherbrooke", limit: 2) == 1)194        #expect(EditDistance.bounded("montreel", "montreal", limit: 2) == 1)195        #expect(EditDistance.bounded("motnreal", "montreal", limit: 2) == 1) // transposition196        #expect(EditDistance.bounded("frontenax", "frontenac", limit: 2) == 1)197        #expect(EditDistance.bounded("abc", "abc", limit: 2) == 0)198        #expect(EditDistance.bounded("kitten", "sitting", limit: 2) == nil)199        #expect(EditDistance.bounded("kitten", "sitting", limit: 3) == 3)200        #expect(EditDistance.bounded("", "ab", limit: 2) == 2)201        #expect(EditDistance.bounded("abcdef", "ab", limit: 2) == nil)202    }203204    @Test func toleranceGrowsWithLength() {205        #expect(EditDistance.tolerance(forLength: 3) == 0)206        #expect(EditDistance.tolerance(forLength: 4) == 1)207        #expect(EditDistance.tolerance(forLength: 5) == 1)208        #expect(EditDistance.tolerance(forLength: 6) == 2)209        #expect(EditDistance.tolerance(forLength: 12) == 2)210    }211}212213@Suite struct QueryParserTests {214    @Test func splitsHouseNumberStreetAndCity() {215        let p = QueryParser.parse("1234 rue Sherbrooke Ouest, Montréal", lastIsPrefix: false)216        #expect(p.houseNumber == "1234")217        #expect(p.streetTokens.map(\.text) == ["rue", "sherbrooke", "ouest"])218        #expect(p.cityTokens == ["montreal"])219        #expect(p.nameTokens.map(\.text) == ["1234", "rue", "sherbrooke", "ouest"])220    }221222    @Test func abbreviatedAddress() {223        let p = QueryParser.parse("1234 Sherbrooke O, Montréal", lastIsPrefix: false)224        #expect(p.houseNumber == "1234")225        #expect(p.streetTokens.map(\.text) == ["sherbrooke", "ouest"])226        #expect(p.cityTokens == ["montreal"])227    }228229    @Test func frenchCommaAfterNumber() {230        let p = QueryParser.parse("1234, rue Sherbrooke Ouest, Montréal, QC H3A 1B9", lastIsPrefix: false)231        #expect(p.houseNumber == "1234")232        #expect(p.streetTokens.map(\.text) == ["rue", "sherbrooke", "ouest"])233        #expect(p.cityTokens == ["montreal"])234    }235236    @Test func cityCleanup() {237        #expect(QueryParser.parse("rue Cartier, Québec, QC, Canada", lastIsPrefix: false).cityTokens == ["quebec"])238        #expect(QueryParser.parse("rue Cartier, Trois-Rivières Québec", lastIsPrefix: false).cityTokens == ["trois", "rivieres"])239        #expect(QueryParser.parse("rue Cartier, Québec G1R 2S9", lastIsPrefix: false).cityTokens == ["quebec"])240    }241242    @Test func numberForms() {243        #expect(QueryParser.parse("1234A rue Ontario", lastIsPrefix: false).houseNumber == "1234A")244        #expect(QueryParser.parse("1234a rue Ontario", lastIsPrefix: false).houseNumber == "1234A")245        #expect(QueryParser.parse("301-1234 rue Ontario", lastIsPrefix: false).houseNumber == "301-1234")246        #expect(QueryParser.parse("12 1/2 rue Ontario", lastIsPrefix: false).houseNumber == "12 1/2")247        #expect(QueryParser.numericCandidates(houseNumber: "301-1234") == [1234, 301])248        #expect(QueryParser.numericCandidates(houseNumber: "1234A") == [1234])249        #expect(QueryParser.numericCandidates(houseNumber: "12 1/2") == [12])250        #expect(QueryParser.leadingNumber("1234A") == 1234)251        #expect(QueryParser.leadingNumber("A") == nil)252        #expect(QueryParser.taggedRange("1010-1014") == 1010...1014)253        #expect(QueryParser.taggedRange("301-12") == nil)254    }255256    @Test func ordinalStreetsAreNotHouseNumbers() {257        #expect(QueryParser.parse("1re Avenue", lastIsPrefix: false).houseNumber == nil)258        #expect(QueryParser.parse("2e Avenue", lastIsPrefix: false).houseNumber == nil)259        #expect(QueryParser.parse("5e rang", lastIsPrefix: false).houseNumber == nil)260        let p = QueryParser.parse("1234 2e Avenue", lastIsPrefix: false)261        #expect(p.houseNumber == "1234")262        #expect(p.streetTokens.map(\.text) == ["2", "avenue"])263    }264265    @Test func namesAreNotAddresses() {266        #expect(QueryParser.parse("Stade olympique", lastIsPrefix: false).houseNumber == nil)267        #expect(QueryParser.parse("1234", lastIsPrefix: false).houseNumber == nil)268        #expect(QueryParser.parse("autoroute 40", lastIsPrefix: false).houseNumber == nil)269        // "3 Brasseurs" reads as an address and as a name: both token lists are kept.270        let p = QueryParser.parse("3 Brasseurs", lastIsPrefix: false)271        #expect(p.houseNumber == "3")272        #expect(p.nameTokens.map(\.text) == ["3", "brasseurs"])273        #expect(QueryParser.parse("   ", lastIsPrefix: false).isEmpty)274    }275276    @Test func prefixGoesToTheLastPart() {277        let a = QueryParser.parse("1000 rue sherb", lastIsPrefix: true)278        #expect(a.streetTokens.last == QueryToken("sherb", isPrefix: true))279        #expect(!a.cityIsPrefix)280        let b = QueryParser.parse("1000 rue Sherbrooke, mont", lastIsPrefix: true)281        #expect(b.streetTokens.allSatisfy { !$0.isPrefix })282        #expect(b.cityIsPrefix)283        #expect(b.cityTokens == ["mont"])284    }285}286287@Suite struct RankingTests {288    private func q(_ s: String, prefix: Bool = false) -> [QueryToken] { TextNormalizer.queryTokens(s, lastIsPrefix: prefix) }289    private func n(_ s: String) -> [String] { TextNormalizer.canonicalTokens(s) }290291    @Test func exactBeatsPrefixBeatsPartial() {292        let exact = TextScorer.score(query: q("sherbrooke"), name: n("Sherbrooke"), ignoreStreetType: false)293        let prefix = TextScorer.score(query: q("sherbrooke"), name: n("Sherbrooke Est"), ignoreStreetType: false)294        let inside = TextScorer.score(query: q("sherbrooke"), name: n("Cégep de Sherbrooke"), ignoreStreetType: false)295        let scattered = TextScorer.score(query: q("laval université"), name: n("Université Laval"), ignoreStreetType: false)296        #expect(exact == 1)297        #expect(exact > prefix)298        #expect(prefix > inside)299        #expect(inside > scattered)300        #expect(scattered > 0)301        #expect(TextScorer.score(query: q("sherbrooke"), name: n("Rue Ontario"), ignoreStreetType: true) == 0)302    }303304    @Test func streetTypeMayBeOmitted() {305        let withType = TextScorer.score(query: q("rue sherbrooke ouest"), name: n("Rue Sherbrooke Ouest"), ignoreStreetType: true)306        let withoutType = TextScorer.score(query: q("sherbrooke ouest"), name: n("Rue Sherbrooke Ouest"), ignoreStreetType: true)307        let strict = TextScorer.score(query: q("sherbrooke ouest"), name: n("Rue Sherbrooke Ouest"), ignoreStreetType: false)308        #expect(withType == 1)309        #expect(withoutType > 0.9)310        #expect(withoutType > strict)311    }312313    @Test func typedPrefixScoresSlightlyLess() {314        let whole = TextScorer.score(query: q("stade olympique"), name: n("Stade olympique"), ignoreStreetType: false)315        let typing = TextScorer.score(query: q("stade olym", prefix: true), name: n("Stade olympique"), ignoreStreetType: false)316        #expect(typing > 0.9)317        #expect(typing < whole)318    }319320    @Test func importanceOrdersPlaces() {321        let city = Importance.rank(place: .city, population: 1_700_000, hasWikidata: true)322        let town = Importance.rank(place: .town, population: 40_000, hasWikidata: true)323        let village = Importance.rank(place: .village, population: 1_500, hasWikidata: false)324        let suburb = Importance.rank(place: .suburb, population: nil, hasWikidata: false)325        #expect(city > town)326        #expect(town > village)327        #expect(village > suburb)328        #expect(Importance.rank(poi: .museum, named: true, hasWikidata: true, hasBrand: false) > Importance.rank(poi: .museum, named: true, hasWikidata: false, hasBrand: false))329        #expect(Importance.rank(poi: .cafe, named: true, hasWikidata: false, hasBrand: true) > Importance.rank(poi: .cafe, named: true, hasWikidata: false, hasBrand: false))330        #expect(Importance.rank(street: .primary, lengthMeters: 5_000, addressCount: 500) > Importance.rank(street: .residential, lengthMeters: 200, addressCount: 10))331    }332333    @Test func distanceViewportAndCityRaiseTheScore() {334        let base = Ranking.Signals(text: 0.8, rank: 30)335        var near = base; near.distance = 200336        var far = base; far.distance = 20_000337        var inView = base; inView.inViewport = true338        var inCity = base; inCity.cityMatches = true339        #expect(Ranking.score(near) > Ranking.score(far))340        #expect(Ranking.score(far) > Ranking.score(base))341        #expect(Ranking.score(inView) > Ranking.score(base))342        #expect(Ranking.score(inCity) > Ranking.score(inView))343        // An exact match on an important place far away still beats a partial match next door.344        let cityFar = Ranking.Signals(text: 1, rank: 95, distance: 150_000)345        let partialNear = Ranking.Signals(text: 0.6, rank: 30, distance: 100)346        #expect(Ranking.score(cityFar) > Ranking.score(partialNear))347        // For a category query the nearer one wins even against a more important one.348        let nearCafe = Ranking.Signals(text: Ranking.categoryTextScore, rank: 30, distance: 150, categoryQuery: true)349        let famousCafe = Ranking.Signals(text: Ranking.categoryTextScore, rank: 45, distance: 3_000, categoryQuery: true)350        #expect(Ranking.score(nearCafe) > Ranking.score(famousCafe))351    }352}353354@Suite struct CategoryTests {355    @Test func identifiersAndCodesAreUnique() {356        #expect(Set(PlaceCategory.allCases.map(\.code)).count == PlaceCategory.allCases.count)357        #expect(Set(PlaceCategory.allCases.map(\.rawValue)).count == PlaceCategory.allCases.count)358        for c in PlaceCategory.allCases {359            #expect(PlaceCategory(code: c.code) == c)360            #expect(PlaceCategory(rawValue: c.rawValue) == c)361            #expect(!c.labelEN.isEmpty && !c.labelFR.isEmpty && !c.symbolName.isEmpty)362            #expect(c.code > 0 && c.code < 256)363        }364        #expect(Set(PlaceType.allCases.map(\.code)).count == PlaceType.allCases.count)365        #expect(Set(StreetClass.allCases.map(\.code)).count == StreetClass.allCases.count)366        #expect(PlaceCategoryGroup.allCases.flatMap(\.categories).count == PlaceCategory.allCases.count)367    }368369    @Test func stableCodes() {370        // Codes are stored in index files: these values must never change.371        #expect(PlaceCategory.restaurant.code == 1)372        #expect(PlaceCategory.cafe.code == 3)373        #expect(PlaceCategory.fuel.code == 20)374        #expect(PlaceCategory.chargingStation.code == 21)375        #expect(PlaceCategory.pharmacy.code == 13)376        #expect(PlaceCategory.toilets.code == 90)377        #expect(PlaceCategory.other.code == 99)378        #expect(PlaceCategory.chargingStation.rawValue == "charging_station")379    }380381    @Test(arguments: [382        ("essence", PlaceCategory.fuel), ("Gas station", .fuel), ("station-service", .fuel), ("dépanneur", .convenience), ("depanneur", .convenience),383        ("épicerie", .grocery), ("café", .cafe), ("CAFE", .cafe), ("pharmacie", .pharmacy), ("borne de recharge", .chargingStation),384        ("toilettes", .toilets), ("eau potable", .drinkingWater), ("hôpital", .hospital), ("stationnement", .parking), ("guichet", .atm),385        ("belvédère", .viewpoint), ("musée", .museum), ("métro", .transitStation), ("hôtel", .lodging), ("parc", .park), ("école", .school),386    ])387    func synonyms(text: String, expected: PlaceCategory) {388        #expect(PlaceCategory.matching(text: text) == expected)389    }390391    @Test func brandsAreNotCategories() {392        #expect(PlaceCategory.matching(text: "SAQ") == nil)393        #expect(PlaceCategory.matching(text: "Tim Hortons") == nil)394        #expect(PlaceCategory.matching(text: "") == nil)395        #expect(PlaceCategory.suggestions(prefix: "pharm") == [.pharmacy])396        #expect(PlaceCategory.suggestions(prefix: "ph").isEmpty)397    }398399    @Test func classifiesOSMTags() {400        #expect(PlaceCategory.classify(tags: ["amenity": "cafe"]) == .cafe)401        #expect(PlaceCategory.classify(tags: ["amenity": "fuel"]) == .fuel)402        #expect(PlaceCategory.classify(tags: ["amenity": "charging_station"]) == .chargingStation)403        #expect(PlaceCategory.classify(tags: ["shop": "convenience"]) == .convenience)404        #expect(PlaceCategory.classify(tags: ["shop": "alcohol", "brand": "SAQ"]) == .liquorStore)405        #expect(PlaceCategory.classify(tags: ["shop": "florist"]) == .shop)406        #expect(PlaceCategory.classify(tags: ["shop": "vacant"]) == nil)407        #expect(PlaceCategory.classify(tags: ["tourism": "viewpoint"]) == .viewpoint)408        #expect(PlaceCategory.classify(tags: ["tourism": "information", "information": "guidepost"]) == nil)409        #expect(PlaceCategory.classify(tags: ["tourism": "information", "information": "office"]) == .information)410        #expect(PlaceCategory.classify(tags: ["railway": "station", "station": "subway"]) == .transitStation)411        #expect(PlaceCategory.classify(tags: ["highway": "bus_stop"]) == .busStop)412        #expect(PlaceCategory.classify(tags: ["leisure": "park"]) == .park)413        #expect(PlaceCategory.classify(tags: ["natural": "peak"]) == .peak)414        #expect(PlaceCategory.classify(tags: ["amenity": "bench"]) == nil)415        #expect(PlaceCategory.classify(tags: ["highway": "residential"]) == nil)416        #expect(PlaceCategory.classify(tags: [:]) == nil)417        #expect(StreetClass(osmValue: "motorway_link") == .motorway)418        #expect(StreetClass(osmValue: "footway") == .path)419        #expect(StreetClass(osmValue: "proposed") == nil)420        #expect(PlaceType(osmValue: "city") == .city)421        #expect(PlaceType(osmValue: "state") == nil)422    }423424    #if canImport(AppKit)425    @Test func symbolNamesExist() {426        for name in Set(PlaceCategory.allCases.map(\.symbolName) + PlaceType.allCases.map(\.symbolName) + StreetClass.allCases.map(\.symbolName)) {427            #expect(SymbolCheck.exists(name), "SF Symbol \(name) not found on this system")428        }429    }430    #endif431}432
Files main
Menu

Theme