-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Add OptionSet tests #11683
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
[stdlib] Add OptionSet tests #11683
Conversation
@swift-ci please smoke test |
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.
I don't remember whether we have the SetAlgebra
conformance tests. But it would be nice to add a test for that too.
OptionSetTests.test("RawValue.SingleOption") { | ||
let s = Days.friday | ||
|
||
assert(s.rawValue == 32) |
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.
Here and everywhere why assert
?
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.
expectEqual
or expectTrue
.
let member1 = s.update(with: .monday) | ||
|
||
assert(s.contains(.monday)) | ||
expectEqual(member1, 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.
expectNil
expectEqual(member1, nil) | ||
|
||
let member2 = s.update(with: .monday) | ||
expectEqual(member2, .monday) |
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.
expectOptionalEqual
I have a separate bug for the SetAlgebra 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.
LGTM
@swift-ci please smoke test |
Test our public OptionSet API
This adds validation tests for the public API of OptionSet.