Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroshevskii committed Jan 14, 2024
1 parent 011eddc commit 7e54a01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public extension BinaryInteger {
/// Examples not considered Ice Cream Sandwich:
///
/// ```swift
/// 121 // Does not have three segments
/// 12 // Does not have three segments
/// 1231 // Does not have identical outer segments
/// 10011 // Does not have identical outer segments
/// ```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ public extension Collection where Element: Hashable {
/// Examples of Ice Cream Sandwich entities:
///
/// ```swift
/// "AABBA"
/// "AABBAA"
/// [1, 2, 2, 1]
/// true, true, false, true, true
/// ```
///
/// Examples not considered Ice Cream Sandwich:
///
/// ```swift
/// "ABBA" // Outer segments must be identical
/// "ABB" // Outer segments must be identical
/// [1, 2, 3, 1] // Must have three segments
/// false, true, false // Fails to meet the pattern requirements
/// false, false // Fails to meet the pattern requirements
/// ```
var isIceCreamSandwich: Bool {
guard count >= 3 else { return false }
Expand Down
8 changes: 4 additions & 4 deletions Tests/IceCreamSandwichTests/IceCreamSandwichTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import XCTest

final class IcecreamSandwichTests: XCTestCase {
func testStringIceCreamSandwich() {
XCTAssertTrue("AABBA".isIceCreamSandwich)
XCTAssertTrue("AABBAA".isIceCreamSandwich)
}

func testArrayIceCreamSandwich() {
Expand All @@ -20,15 +20,15 @@ final class IcecreamSandwichTests: XCTestCase {
}

func testStringNotIceCreamSandwich() {
XCTAssertFalse("ABBA".isIceCreamSandwich)
XCTAssertFalse("ABB".isIceCreamSandwich)
}

func testArrayNotIceCreamSandwich() {
XCTAssertFalse([1, 2, 3, 1].isIceCreamSandwich)
}

func testBoolArrayNotIceCreamSandwich() {
XCTAssertFalse([false, true, false].isIceCreamSandwich)
XCTAssertFalse([false, false].isIceCreamSandwich)
}

func testTooShortCollection() {
Expand All @@ -44,7 +44,7 @@ final class IcecreamSandwichTests: XCTestCase {
}

func testIntegerNotIceCreamSandwich() {
XCTAssertFalse(121.isIceCreamSandwich)
XCTAssertFalse(12.isIceCreamSandwich)
}

func testAnotherIntegerNotIceCreamSandwich() {
Expand Down

0 comments on commit 7e54a01

Please sign in to comment.