Add logic for more customizable password generator

This commit is contained in:
Danny Moesch 2020-02-28 19:04:53 +01:00 committed by Mingshen Sun
parent 49a371d495
commit ff014a5699
10 changed files with 352 additions and 131 deletions

View file

@ -0,0 +1,29 @@
//
// Array+SlicesTest.swift
// passKitTests
//
// Created by Danny Moesch on 28.02.20.
// Copyright © 2020 Bob Sun. All rights reserved.
//
import XCTest
@testable import passKit
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]])
}
}