mirror of
https://github.com/mssun/passforios.git
synced 2026-02-27 18:24:03 +01:00
Use their latest releases and fix some violations and issues. # Conflicts: # .github/workflows/linting.yml # .github/workflows/testing.yml
29 lines
754 B
Swift
29 lines
754 B
Swift
//
|
|
// Array+SlicesTest.swift
|
|
// passKitTests
|
|
//
|
|
// Created by Danny Moesch on 28.02.20.
|
|
// Copyright © 2020 Bob Sun. All rights reserved.
|
|
//
|
|
|
|
import XCTest
|
|
|
|
@testable import passKit
|
|
|
|
final class ArraySlicesTest: XCTestCase {
|
|
func testZeroCount() {
|
|
XCTAssertEqual([1, 2, 3].slices(count: 0), [])
|
|
}
|
|
|
|
func testEmptyArray() {
|
|
XCTAssertEqual(([] as [String]).slices(count: 4), [[], [], [], []])
|
|
}
|
|
|
|
func testSlices() {
|
|
XCTAssertEqual([1, 2, 3].slices(count: 3), [[1], [2], [3]])
|
|
XCTAssertEqual([1, 2, 3, 4].slices(count: 3), [[1], [2], [3, 4]])
|
|
XCTAssertEqual([1, 2, 3, 4].slices(count: 2), [[1, 2], [3, 4]])
|
|
XCTAssertEqual([1, 2, 3, 4, 5].slices(count: 2), [[1, 2], [3, 4, 5]])
|
|
}
|
|
}
|