From 1acc2136d9bcbbfc2dea824ae9622e4ddcaa3bf1 Mon Sep 17 00:00:00 2001 From: michiboo Date: Wed, 20 Jan 2021 15:23:38 +0200 Subject: [PATCH] add test for suffix --- Tests/SwiftAlgorithmsTests/SuffixTests.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Tests/SwiftAlgorithmsTests/SuffixTests.swift diff --git a/Tests/SwiftAlgorithmsTests/SuffixTests.swift b/Tests/SwiftAlgorithmsTests/SuffixTests.swift new file mode 100644 index 0000000..3d9827c --- /dev/null +++ b/Tests/SwiftAlgorithmsTests/SuffixTests.swift @@ -0,0 +1,20 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift Algorithms open source project +// +// Copyright (c) 2020 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// +//===----------------------------------------------------------------------===// + +import XCTest +import Algorithms + +final class SuffixTests: XCTestCase { + + func testSuffix() { + let a = 0...10 + XCTAssertEqualSequences(a.suffix(while: { $0 > 5 }), (6...10)) +}