From bf1de3240d6e6acac989848bc7a9e1abdedb4475 Mon Sep 17 00:00:00 2001 From: Matt Zanchelli Date: Mon, 15 Feb 2021 13:31:34 -0800 Subject: [PATCH] Add unit tests for reverse functions --- Tests/SwiftAlgorithmsTests/RotateTests.swift | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Tests/SwiftAlgorithmsTests/RotateTests.swift b/Tests/SwiftAlgorithmsTests/RotateTests.swift index 01b47d0..8d369bb 100644 --- a/Tests/SwiftAlgorithmsTests/RotateTests.swift +++ b/Tests/SwiftAlgorithmsTests/RotateTests.swift @@ -10,9 +10,27 @@ //===----------------------------------------------------------------------===// import XCTest -import Algorithms +@testable import Algorithms final class RotateTests: XCTestCase { + /// Tests the example given in `_reverse(subrange:until:)`’s documentation + func testUnderscoreReverse() { + var input = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p"] + let limit: Int = 4 + let (lower, upper) = input._reverse(subrange: input.startIndex..