From 01c73b89dc200865d1a686c7edf45968cbd4fa87 Mon Sep 17 00:00:00 2001 From: Karl Wagner <5254025+karwa@users.noreply.github.com> Date: Sat, 9 Sep 2023 16:55:36 +0200 Subject: [PATCH] Add tests for replacing the entire base collection --- .../ReplaceSubrangeTests.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tests/SwiftAlgorithmsTests/ReplaceSubrangeTests.swift b/Tests/SwiftAlgorithmsTests/ReplaceSubrangeTests.swift index f57aae61..ca6c9934 100644 --- a/Tests/SwiftAlgorithmsTests/ReplaceSubrangeTests.swift +++ b/Tests/SwiftAlgorithmsTests/ReplaceSubrangeTests.swift @@ -176,5 +176,23 @@ final class ReplaceSubrangeTests: XCTestCase { XCTAssertEqualCollections(result, "hello, wo") IndexValidator().validate(result, expectedCount: 9) } + + // Location: entire collection + // Replacement: non-empty + do { + let base = "hello, world!" + let result = base.lazy.replacingSubrange(base.startIndex..