Update unit tests - #3
Merged
Merged
Conversation
Implements locations, amenities, site amenities, restaurants, states, interstates, prompts, and configuration lookups against data.sqlite using raw SQL through this package's Connection/PreparedStatement API, plus search/state/site/interstate/amenity filtering for locations. Tests port the data-content assertions (counts, first-row values, filter results) onto this API, dropping the parts that depended on a query-builder DSL or a separate model/persistence layer this package doesn't have.
Demonstrates combining an R*Tree virtual table for a fast bounding-box prefilter with a registered `distance` scalar function (haversine) to filter and sort sites by great-circle distance from a query point. Loads real coordinates from the bundled fixture; verified on macOS and Linux (R*Tree is enabled in swift-sqlcipher's default traits). Adds latitude/longitude to DataFile.Location so coordinates read through the existing API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DataFiletest helper with entity models —Location,Amenity,Amenity.Site,Restaurant,State,Interstate,Prompt, andConfiguration— each backed by raw SQL through this package'sConnection/PreparedStatementAPI.filterSiteAmenitiesandfilterInterstates.DataFileTestscovering data-content assertions against the bundleddata.sqlitefixture: row counts, first-row values, and filter results (search/state/site, amenity, and interstate cases).Notes
prepare/failableNext/rowDictionaries, parameter binding, andIN (...)filtering end-to-end.Test plan
swift build/swift teston macOS — all 35 tests pass (12 new + 23 existing).