-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always retain ref if exist #99
Conversation
c23db8b
to
f914f30
Compare
Added a test suite because I like tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough tests! Code coverage is looking a lot better in RouteStep.swift now.
r = Road(name: "Way Name", ref: nil, destination: nil, rotaryName: nil) | ||
XCTAssertEqual(r.names!, [ "Way Name" ]) | ||
XCTAssertNil(r.codes) | ||
r = Road(name: "Way Name 1; Way Name 2", ref: nil, destination: nil, rotaryName: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test for values delimited by a colon but not a space, since that's the usual OSM tagging convention.
|
||
// Name only | ||
r = Road(name: "Way Name", ref: nil, destination: nil, rotaryName: nil) | ||
XCTAssertEqual(r.names!, [ "Way Name" ]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force-unwrapping names here will cause the test case to crash on this line if names is nil for some reason. Instead, fall back to an empty array so that this assertion fails but the test can continue and report about other failures.
f914f30
to
76426cb
Compare
@1ec5 thanks, feedback incorporated |
Add a test suite for Road
76426cb
to
a1a8ca1
Compare
This also made it into the |
An oversight in #91
It would actually be nice to UnitTest the
Road
class to document all cases we expect.