Skip to content

Commit

Permalink
4.3 App Store
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Scheffer committed Aug 10, 2021
1 parent 517d30a commit 9321889
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Tests/ChartsTests/ChartDataTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,28 @@ class ChartDataTests: XCTestCase {
let res = set.entriesForXValue(Double(1621860300))
let res2 = set.entriesForXValue(Double(1621860310))

XCTAssertTrue(res?.advanced(by: 1) == res2)
XCTAssertTrue(res.first == set[slowMatch!])
XCTAssertTrue(res2.first == nil)

let up = set.entryIndex(x: set.last!.x + 1, closestToY: .nan, rounding: .up)

XCTAssertTrue(up == -1)

let upClosest = set.entryIndex(x: set.last!.x + 1 , closestToY: .nan, rounding: .closest)

XCTAssertTrue(upClosest == set.endIndex - 1)

let down = set.entryIndex(x: set.last!.x + 1, closestToY: .nan, rounding: .down)

XCTAssertTrue(down == set.endIndex - 1)

let minDown = set.entryIndex(x: set.first!.x - 1, closestToY: .nan, rounding: .down)

XCTAssertTrue(minDown == -1)

let minUp = set.entryIndex(x: set.first!.x - 1, closestToY: .nan, rounding: .up)

XCTAssertTrue(minUp == 0)

let closestIdx = set.entryIndex(x: Double(1621860310), closestToY: .nan, rounding: .closest)

Expand Down

0 comments on commit 9321889

Please sign in to comment.