-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Resubmit of #2730 #3002
Merged
Merged
Resubmit of #2730 #3002
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d1b4fcf
Resubmit of #2730
jjatie cd0b984
Merge branch 'master' into equatable-fixed
jjatie d864fb5
Made use of `==` where appropriate to simplify logic
jjatie 48386a3
Merge remote-tracking branch 'origin/equatable-fixed' into equatable-…
jjatie 0ef8aa1
Merge remote-tracking branch 'upstream/master' into equatable-fixed
jjatie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// EquatableTests.swift | ||
// Charts | ||
// | ||
// Created by Jacob Christie on 2017-11-13. | ||
// | ||
|
||
import XCTest | ||
@testable import Charts | ||
|
||
class EquatableTests: XCTestCase { | ||
func testChartDataEntryEquality() { | ||
let image = UIImage() | ||
let data = NSObject() | ||
let entry1 = ChartDataEntry(x: 5, y: 3, icon: image, data: data) | ||
let entry2 = ChartDataEntry(x: 5, y: 3, icon: image, data: data) | ||
|
||
XCTAssertTrue(entry1 == entry2) | ||
} | ||
|
||
func testChartDataEntryInequality() { | ||
let image = UIImage() | ||
let data1 = NSObject() | ||
let data2 = NSObject() | ||
let entry1 = ChartDataEntry(x: 5, y: 3, icon: image, data: data1) | ||
let entry2 = ChartDataEntry(x: 5, y: 3, icon: image, data: data2) | ||
|
||
XCTAssertFalse(entry1 == entry2) | ||
} | ||
|
||
func testHighlightEquality() { | ||
let high1 = Highlight(x: 5, y: 3, xPx: 1, yPx: -1, dataSetIndex: 8, stackIndex: 8, axis: .right) | ||
let high2 = Highlight(x: 5, y: 3, xPx: 1, yPx: -1, dataSetIndex: 8, stackIndex: 8, axis: .right) | ||
|
||
XCTAssertTrue(high1 == high2) | ||
} | ||
|
||
func testHighlightInequality() { | ||
let high1 = Highlight(x: 5, y: 3, xPx: 1, yPx: -1, dataSetIndex: 8, stackIndex: 8, axis: .left) | ||
let high2 = Highlight(x: 5, y: 3, xPx: 1, yPx: -1, dataSetIndex: 8, stackIndex: 9, axis: .left) | ||
|
||
XCTAssertFalse(high1 == high2) | ||
} | ||
} | ||
|
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.
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 made the same template as yours for combined chart test. Shall we include the license info just like source code template, or test file is fine with default Xcode template?
The old test file does not have a template as well
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 guess we should be putting in the license info to be consistent. Do we keep it the same, but whose name do we use?
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 would just use the same template as source code. I don't know the rule of names.
Personally I just use
Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
, and I don't need to specify who created the file.I think this is a good question, as I saw some files with yours template:
I guess we need an unified one. @petester42 @danielgindi @PhilJay insights?
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.
Yea, I just use the Xcode default.