diff --git a/test/AutoDiff/stdlib/anydifferentiable.swift b/test/AutoDiff/stdlib/anydifferentiable.swift index 8657fb8141d..7812d457d4a 100644 --- a/test/AutoDiff/stdlib/anydifferentiable.swift +++ b/test/AutoDiff/stdlib/anydifferentiable.swift @@ -14,7 +14,7 @@ struct Generic: Differentiable, Equatable { } extension AnyDerivative { - // This exists only to faciliate testing. + // This exists only to facilitate testing. func moved(along offset: TangentVector) -> Self { var result = self result.move(by: offset) diff --git a/test/stdlib/AnyHashableCasts.swift.gyb b/test/stdlib/AnyHashableCasts.swift.gyb index 2f516bdc8a8..96bcc2caab8 100644 --- a/test/stdlib/AnyHashableCasts.swift.gyb +++ b/test/stdlib/AnyHashableCasts.swift.gyb @@ -250,19 +250,19 @@ AnyHashableCasts.test("Wrappers around bridged strings") { expectTrue(stringHello.base is String) expectTrue(nsStringHello.base is NSString) // Through bridging - // Swift wrapper's AnyHashable form doesn't enfore type identity. + // Swift wrapper's AnyHashable form doesn't enforce type identity. expectNotNil(wrapper1Hello as? StringWrapper1) expectNotNil(wrapper1Hello as? StringWrapper2) expectNotNil(wrapper1Hello as? String) expectNotNil(wrapper1Hello as? NSString) - // String's AnyHashable form doesn't enfore type identity. + // String's AnyHashable form doesn't enforce type identity. expectNotNil(stringHello as? StringWrapper1) expectNotNil(stringHello as? StringWrapper2) expectNotNil(stringHello as? String) expectNotNil(stringHello as? NSString) - // NSString's AnyHashable form doesn't enfore type identity. + // NSString's AnyHashable form doesn't enforce type identity. expectNotNil(nsStringHello as? StringWrapper1) expectNotNil(nsStringHello as? StringWrapper2) expectNotNil(nsStringHello as? String) diff --git a/test/stdlib/FlatMapDeprecation.swift b/test/stdlib/FlatMapDeprecation.swift index 14202e45c82..e6e03ea7c21 100644 --- a/test/stdlib/FlatMapDeprecation.swift +++ b/test/stdlib/FlatMapDeprecation.swift @@ -25,7 +25,7 @@ where C.Elements : BidirectionalCollection { _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} } -func flatMapOnCollectinoOfStrings< +func flatMapOnCollectionOfStrings< C : Collection >(xs: C, f: (C.Element) -> String?) { _ = xs.flatMap(f) // expected-warning {{'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value}} expected-note {{compactMap}} diff --git a/test/stdlib/ForEachField.swift b/test/stdlib/ForEachField.swift index 32ca402aca6..194f2bf99be 100644 --- a/test/stdlib/ForEachField.swift +++ b/test/stdlib/ForEachField.swift @@ -107,7 +107,7 @@ struct LetKeyPaths { let double: Double } -protocol TestExisential {} +protocol TestExistential {} struct KeyPathTypes { weak var weakObj: TestClass? @@ -118,7 +118,7 @@ struct KeyPathTypes { var function: (Int) -> (Int) var optionalFunction: (Int) -> (Int)? var enumField: TestEnum - var existential: TestExisential + var existential: TestExistential var existentialMetatype: Any.Type var metatype: Int.Type } diff --git a/test/stdlib/Integers.swift.gyb b/test/stdlib/Integers.swift.gyb index 23421afe14e..fceb7d45811 100644 --- a/test/stdlib/Integers.swift.gyb +++ b/test/stdlib/Integers.swift.gyb @@ -420,7 +420,7 @@ tests.test("CountLeadingZeros") { expectEqual(0, Int8.min.leadingZeroBitCount) } -tests.test("CountTrainlingZeros") { +tests.test("CountTrailingZeros") { expectEqual(0, UInt8.max.trailingZeroBitCount) expectEqual(8, UInt8.min.trailingZeroBitCount) expectEqual(0, Int8.max.trailingZeroBitCount) diff --git a/test/stdlib/LazySlice.swift b/test/stdlib/LazySlice.swift index 5b81fea07d8..d2a0292b6aa 100644 --- a/test/stdlib/LazySlice.swift +++ b/test/stdlib/LazySlice.swift @@ -6,7 +6,7 @@ import StdlibUnittest var tests = TestSuite("LazySlice") -tests.test("CommuteLazyness") { +tests.test("CommuteLaziness") { let a = [1,2,3].lazy let b = a[...] var c = b.filter { $0 == 0 } diff --git a/test/stdlib/NewStringAppending.swift b/test/stdlib/NewStringAppending.swift index e91e9ac5166..38fa86716d4 100644 --- a/test/stdlib/NewStringAppending.swift +++ b/test/stdlib/NewStringAppending.swift @@ -11,7 +11,7 @@ // REQUIRES: CPU=x86_64, OS=macosx // UNSUPPORTED: use_os_stdlib -// TODO: Adapt capacity checks into a non-FileCheck more exhuastive test that +// TODO: Adapt capacity checks into a non-FileCheck more exhaustive test that // can run on older OSes and match their behavior... import Foundation diff --git a/test/stdlib/OSLogExecutionTest.swift b/test/stdlib/OSLogExecutionTest.swift index 9aff68ade3b..3fe204ccaf9 100644 --- a/test/stdlib/OSLogExecutionTest.swift +++ b/test/stdlib/OSLogExecutionTest.swift @@ -36,7 +36,7 @@ internal struct OSLogBufferChecker { buffer = byteBuffer } - /// Bit mask for setting bits in the peamble. The bits denoted by the bit + /// Bit mask for setting bits in the preamble. The bits denoted by the bit /// mask indicate whether there is an argument that is private, and whether /// there is an argument that is non-scalar: String, NSObject or Pointer. internal enum PreambleBitMask: UInt8 { diff --git a/test/stdlib/RuntimeObjC.swift b/test/stdlib/RuntimeObjC.swift index 75e96237b60..b6f59361b58 100644 --- a/test/stdlib/RuntimeObjC.swift +++ b/test/stdlib/RuntimeObjC.swift @@ -793,8 +793,8 @@ RuntimeClassNamesTestSuite.test("private class nested in same-type-constrained e let base: NSData? = nil let util = base.asInner - let clas = unsafeBitCast(type(of: util), to: NSObject.self) - let desc = clas.description + let clazz = unsafeBitCast(type(of: util), to: NSObject.self) + let desc = clazz.description expectEqual("_TtCE1a", desc.prefix(7)) expectEqual("Inner", desc.suffix(5)) } diff --git a/test/stdlib/StringAPI.swift b/test/stdlib/StringAPI.swift index 146a8eb80f4..f0e6f045e5b 100644 --- a/test/stdlib/StringAPI.swift +++ b/test/stdlib/StringAPI.swift @@ -390,7 +390,7 @@ StringTests.test("Regression/corelibs-foundation") { } //If we come here, then the range has created unpaired surrogates on either end. //An unpaired surrogate is replaced by OXFFFD - the Unicode Replacement Character. - //The CRLF ("\r\n") sequence is also treated like a surrogate pair, but its constinuent + //The CRLF ("\r\n") sequence is also treated like a surrogate pair, but its constituent //characters "\r" and "\n" can exist outside the pair! let replacementCharacter = String(describing: UnicodeScalar(0xFFFD)!) diff --git a/test/stdlib/StringIndex.swift b/test/stdlib/StringIndex.swift index 47ec888d6ae..11123c6e271 100644 --- a/test/stdlib/StringIndex.swift +++ b/test/stdlib/StringIndex.swift @@ -392,7 +392,7 @@ suite.test("Exhaustive Index Interchange") let curSubChar = str[curScalarIdx] // If there is a Character prior to this scalar, remember it and check - // that misalignd code unit indices also produce it. + // that misaligned code unit indices also produce it. let scalarPriorCharacter: Character? if scalarStartIdx == str.startIndex { scalarPriorCharacter = nil diff --git a/test/stdlib/TestScanner.swift b/test/stdlib/TestScanner.swift index a0129a5e6ae..264878694c6 100644 --- a/test/stdlib/TestScanner.swift +++ b/test/stdlib/TestScanner.swift @@ -163,7 +163,7 @@ class TestScanner : TestScannerSuper { expectEqual($0.scanInt64(), -1 as Int64, "Minus one") expectEqual($0.scanInt64(), -1 as Int64, "Minus one after whitespace") expectEqual($0.scanInt64(), Int64.min, "Min") - expectEqual($0.scanInt64(), Int64.max, "Max again after min (no joining it with preceding min even with ignroed whitespace)") + expectEqual($0.scanInt64(), Int64.max, "Max again after min (no joining it with preceding min even with ignored whitespace)") } // Overflow: @@ -184,7 +184,7 @@ class TestScanner : TestScannerSuper { expectEqual($0.scanInt32(), -1 as Int32, "Minus one") expectEqual($0.scanInt32(), -1 as Int32, "Minus one after whitespace") expectEqual($0.scanInt32(), Int32.min, "Min") - expectEqual($0.scanInt32(), Int32.max, "Max again after min (no joining it with preceding min even with ignroed whitespace)") + expectEqual($0.scanInt32(), Int32.max, "Max again after min (no joining it with preceding min even with ignored whitespace)") } // Overflow: diff --git a/test/stdlib/UnsafePointerDiagnostics.swift b/test/stdlib/UnsafePointerDiagnostics.swift index ae45c9e0b98..52c0b226d2e 100644 --- a/test/stdlib/UnsafePointerDiagnostics.swift +++ b/test/stdlib/UnsafePointerDiagnostics.swift @@ -131,7 +131,7 @@ struct SR9800 { func foo(_: UnsafePointer) {} func ambiguityTest(buf: UnsafeMutablePointer) { - foo(UnsafePointer(buf)) // this call should be unambiguoius + foo(UnsafePointer(buf)) // this call should be unambiguous } } diff --git a/test/stdlib/UnsafeRawBufferPointer.swift b/test/stdlib/UnsafeRawBufferPointer.swift index 736634e2552..fa06e111c27 100644 --- a/test/stdlib/UnsafeRawBufferPointer.swift +++ b/test/stdlib/UnsafeRawBufferPointer.swift @@ -446,7 +446,7 @@ UnsafeRawBufferPointerTestSuite.test("copyMemory.overflow") { #endif // Use copyBytes without contiguous storage -UnsafeRawBufferPointerTestSuite.test("copyBytes.withoutContiguouseStorage") { +UnsafeRawBufferPointerTestSuite.test("copyBytes.withoutContiguousStorage") { let ranges: [Range] = [0..<2, 1..<3, 2..<4, 3..<5] var array = [UInt8](repeating: 0, count: 2) for range in ranges { diff --git a/test/stdlib/VarArgs.swift b/test/stdlib/VarArgs.swift index 5d7459ed7ae..9e5c36c52d7 100644 --- a/test/stdlib/VarArgs.swift +++ b/test/stdlib/VarArgs.swift @@ -134,7 +134,7 @@ func test_varArgs5() { // the GP register-save area after the SSE register-save area was // exhausted, rather than spilling into the overflow argument area. // - // This is not caught by test_varArgs1 above, because it exhauses the + // This is not caught by test_varArgs1 above, because it exhausts the // GP register-save area before the SSE area. var format = "rdar-32547102: " diff --git a/test/stdlib/symbol-visibility-darwin.test-sh b/test/stdlib/symbol-visibility-darwin.test-sh index 8c6bb2588c7..d37da8a82dc 100644 --- a/test/stdlib/symbol-visibility-darwin.test-sh +++ b/test/stdlib/symbol-visibility-darwin.test-sh @@ -14,7 +14,7 @@ // RUN: %llvm-nm --defined-only --extern-only --no-weak --demangle %platform-dylib-dir/%target-library-name(swiftRemoteMirror) > %t/swiftRemoteMirror-no-weak.txt // RUN: diff -u %t/swiftRemoteMirror-all.txt %t/swiftRemoteMirror-no-weak.txt -// NOTE: swiftDemanging is not checked because it is incorportated into +// NOTE: swiftDemanging is not checked because it is incorporated into // swiftCore and swiftRemoteMirror. Both of those checks ensure that the // symbols are handled properly. diff --git a/test/stdlib/symbol-visibility-linux.test-sh b/test/stdlib/symbol-visibility-linux.test-sh index 77946ebe2ad..89f8ec6a012 100644 --- a/test/stdlib/symbol-visibility-linux.test-sh +++ b/test/stdlib/symbol-visibility-linux.test-sh @@ -66,7 +66,7 @@ // RUN: %llvm-nm --defined-only --extern-only --no-weak %platform-dylib-dir/%target-library-name(swiftRemoteMirror) > %t/swiftRemoteMirror-no-weak.txt // RUN: diff -u %t/swiftRemoteMirror-all.txt %t/swiftRemoteMirror-no-weak.txt -// NOTE: swiftDemanging is not checked because it is incorportated into +// NOTE: swiftDemanging is not checked because it is incorporated into // swiftCore and swiftRemoteMirror. Both of those checks ensure that the // symbols are handled properly. diff --git a/validation-test/stdlib/Arrays.swift.gyb b/validation-test/stdlib/Arrays.swift.gyb index 30b9fd12dfe..65c1a54f1e3 100644 --- a/validation-test/stdlib/Arrays.swift.gyb +++ b/validation-test/stdlib/Arrays.swift.gyb @@ -1364,7 +1364,7 @@ for (step, evilBoundsCheck) in [ (1, true), (-1, false), (-1, true) ] { ? "invalid Collection: less than 'count' elements in collection" : "invalid Collection: more than 'count' elements in collection" - // The invalid Collection error is a _debugPreconditon that will only fire + // The invalid Collection error is a _debugPrecondition that will only fire // in a Debug assert configuration. let expectedToFail = (step < 0 && evilBoundsCheck) || _isDebugAssertConfiguration() diff --git a/validation-test/stdlib/ErrorHandling.swift b/validation-test/stdlib/ErrorHandling.swift index eedf51bb586..a051cd17c21 100644 --- a/validation-test/stdlib/ErrorHandling.swift +++ b/validation-test/stdlib/ErrorHandling.swift @@ -346,10 +346,10 @@ ErrorHandlingTests.test("ErrorHandling/sort") { forAllPermutations(collection) { sequence in for i in 0.. Bool in - if b == throwElment { + if b == throwElement { throw SillyError.JazzHands } return a < b @@ -367,11 +367,11 @@ ErrorHandlingTests.test("ErrorHandling/sorted") { for i in 0.. Bool in - if b == throwElment { + if b == throwElement { thrown = true throw SillyError.JazzHands } @@ -396,10 +396,10 @@ ErrorHandlingTests.test("ErrorHandling/sort") { forAllPermutations(collection) { sequence in for i in 0.. Bool in - if b == throwElment { + if b == throwElement { throw SillyError.JazzHands } return a < b @@ -417,11 +417,11 @@ ErrorHandlingTests.test("ErrorHandling/sorted") { for i in 0.. Bool in - if b == throwElment { + if b == throwElement { thrown = true throw SillyError.JazzHands } diff --git a/validation-test/stdlib/ExistentialCollection.swift.gyb b/validation-test/stdlib/ExistentialCollection.swift.gyb index 52a35e58e09..7e6705398f6 100644 --- a/validation-test/stdlib/ExistentialCollection.swift.gyb +++ b/validation-test/stdlib/ExistentialCollection.swift.gyb @@ -338,7 +338,7 @@ tests.test("BidirectionalCollection") { } // Can't upgrade a non-random-access collection to random access - let s0 = "Hello, Woyld" + let s0 = "Hello, World" let bc1 = AnyBidirectionalCollection(s0) let fc3 = AnyCollection(bc1) expectTrue(storesSameUnderlyingCollection(fc3, bc1)) diff --git a/validation-test/stdlib/OptionSet.swift b/validation-test/stdlib/OptionSet.swift index df3e8f266a1..137fc0366c7 100644 --- a/validation-test/stdlib/OptionSet.swift +++ b/validation-test/stdlib/OptionSet.swift @@ -134,7 +134,7 @@ OptionSetTests.test("Contains.EmptySet") { expectFalse(s.contains(.saturday)) } -// Test formItersection() +// Test formIntersection() OptionSetTests.test("FormIntersection.SingleOption") { do { diff --git a/validation-test/stdlib/Set.swift b/validation-test/stdlib/Set.swift index d42cbee1f7b..a887d8bdaec 100644 --- a/validation-test/stdlib/Set.swift +++ b/validation-test/stdlib/Set.swift @@ -3762,7 +3762,7 @@ SetTestSuite.test("SetAlgebra.Contains.EmptySet") { expectFalse(s.contains(1070)) } -// Test formItersection() +// Test formIntersection() SetTestSuite.test("SetAlgebra.FormIntersection.SingleEntry") { do { diff --git a/validation-test/stdlib/String.swift b/validation-test/stdlib/String.swift index 8c89817b6e9..cda85497c13 100644 --- a/validation-test/stdlib/String.swift +++ b/validation-test/stdlib/String.swift @@ -1132,7 +1132,7 @@ StringTests.test("toInt") { // Make a String from an Int, mangle the String's characters, // then print if the new String is or is not still an Int. - func testConvertabilityOfStringWithModification( + func testConvertibilityOfStringWithModification( _ initialValue: Int, modification: (_ chars: inout [UTF8.CodeUnit]) -> Void ) { @@ -1142,11 +1142,11 @@ StringTests.test("toInt") { expectNil(Int(str)) } - testConvertabilityOfStringWithModification(Int.min) { + testConvertibilityOfStringWithModification(Int.min) { $0[2] += 1; () // underflow by lots } - testConvertabilityOfStringWithModification(Int.max) { + testConvertibilityOfStringWithModification(Int.max) { $0[1] += 1; () // overflow by lots } @@ -1859,7 +1859,7 @@ struct COWStringTest { } var testCases: [COWStringTest] { - return [ COWStringTest(test: "abcdefghijklmnopqrxtuvwxyz", name: "ASCII"), + return [ COWStringTest(test: "abcdefghijklmnopqrstuvwxyz", name: "ASCII"), COWStringTest(test: "🐮🐄🤠👢🐴", name: "Unicode") ] } diff --git a/validation-test/stdlib/StringViews.swift b/validation-test/stdlib/StringViews.swift index 9be2e2539a6..1024175a0f2 100644 --- a/validation-test/stdlib/StringViews.swift +++ b/validation-test/stdlib/StringViews.swift @@ -184,8 +184,8 @@ tests.test("index-mapping/utf16-to-utf8/\(id)") { [0xf0, 0x9f, 0x8f], // Prior to UTF-8 String, this tested for empty array in "legacy mode" or - // the replacemnet character otherwise. However, SE-0180 (String Index - // Overhual) dictates subscript behavior should treat it as emergent + // the replacement character otherwise. However, SE-0180 (String Index + // Overhaul) dictates subscript behavior should treat it as emergent // behavior from its encoded offset, hence we should get the same 3 code // units as prior for non-scalar-aligned UTF-16 offsets applied to the // UTF-8 view. @@ -455,8 +455,8 @@ tests.test("index-mapping/utf16-to-unicode-scalar/\(id)") { UnicodeScalar(0x1f3c2), // Prior to UTF-8 String, this tested for empty array in "legacy mode" or - // the replacemnet character otherwise. However, SE-0180 (String Index - // Overhual) dictates subscript behavior should treat it as emergent + // the replacement character otherwise. However, SE-0180 (String Index + // Overhaul) dictates subscript behavior should treat it as emergent // behavior from its encoded offset, hence we should get the same 3 code // units as prior for non-scalar-aligned UTF-16 offsets applied to the // UTF-8 view. @@ -589,8 +589,8 @@ tests.test("index-mapping/utf16-to-character/\(id)") { "🏂", // Prior to UTF-8 String, this tested for empty array in "legacy mode" or - // the replacemnet character otherwise. However, SE-0180 (String Index - // Overhual) dictates subscript behavior should treat it as emergent + // the replacement character otherwise. However, SE-0180 (String Index + // Overhaul) dictates subscript behavior should treat it as emergent // behavior from its encoded offset, hence we should get the same 3 code // units as prior for non-scalar-aligned UTF-16 offsets applied to the // UTF-8 view. Under a mixed-encoding String model, we necessarily have to diff --git a/validation-test/stdlib/UnicodeTrieGenerator.gyb b/validation-test/stdlib/UnicodeTrieGenerator.gyb index 709e39c058f..c2174679b64 100644 --- a/validation-test/stdlib/UnicodeTrieGenerator.gyb +++ b/validation-test/stdlib/UnicodeTrieGenerator.gyb @@ -35,7 +35,7 @@ def test_trie_generation(property_table, configure_generator=None): trie_generator.supp_data_bytes_offset - trie_generator.supp_lookup2_bytes_offset, len(trie_generator.trie_bytes) - trie_generator.supp_data_bytes_offset)) -class PerfectlyCompressableProperty(UnicodeProperty): +class PerfectlyCompressibleProperty(UnicodeProperty): def __init__(self): pass @@ -53,9 +53,9 @@ class PerfectlyCompressableProperty(UnicodeProperty): def get_numeric_value(self, cp): return self.to_numeric_value(self.get_value(cp)) -print('PerfectlyCompressableProperty') -test_trie_generation(PerfectlyCompressableProperty()) -# CHECK-LABEL: PerfectlyCompressableProperty +print('PerfectlyCompressibleProperty') +test_trie_generation(PerfectlyCompressibleProperty()) +# CHECK-LABEL: PerfectlyCompressibleProperty # CHECK: (8, 8, 5, 8, 8, 1, 1, 1, 1, 1, 1041, 256, 256, 17, 256, 256) # # Explanation for table sizes above: @@ -67,7 +67,7 @@ test_trie_generation(PerfectlyCompressableProperty()) # supp_data: 1 x 1*256 = 256 -class UncompressableProperty(UnicodeProperty): +class UncompressibleProperty(UnicodeProperty): def __init__(self): pass @@ -93,9 +93,9 @@ class UncompressableProperty(UnicodeProperty): def get_numeric_value(self, cp): return self.to_numeric_value(self.get_value(cp)) -print('UncompressableProperty, default trie parameters') -test_trie_generation(UncompressableProperty()) -# CHECK-LABEL: UncompressableProperty, default trie parameters +print('UncompressibleProperty, default trie parameters') +test_trie_generation(UncompressibleProperty()) +# CHECK-LABEL: UncompressibleProperty, default trie parameters # CHECK: (8, 8, 5, 8, 8, 2, 1, 1, 2, 1, 1123601, 512, 65536, 17, 8704, 1048832) # # Explanation for table sizes above: @@ -112,10 +112,10 @@ def configure_generator_for_16_bit_indexes(trie_generator): trie_generator.supp_first_level_index_bits = 10 trie_generator.supp_second_level_index_bits = 2 -print('UncompressableProperty, 16-bit indexes') -test_trie_generation(UncompressableProperty(), +print('UncompressibleProperty, 16-bit indexes') +test_trie_generation(UncompressibleProperty(), configure_generator_for_16_bit_indexes) -# CHECK-LABEL: UncompressableProperty, 16-bit indexes +# CHECK-LABEL: UncompressibleProperty, 16-bit indexes # CHECK: (9, 7, 10, 2, 9, 2, 1, 2, 2, 1, 1120840, 1024, 65536, 1088, 4104, 1049088) # # Explanation for table sizes above: