Spelling stdlib (#42544)

* spelling: abcdefghijklmnopqrstuvwxyz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clazz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: collection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constituent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: convertibility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: element

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: enforce

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhaustive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhausts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: existential

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facilitate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignored

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incorporated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intersection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: laziness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: misaligned

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overhaul

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: preamble

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: precondition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: replacement

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trailing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unambiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uncompressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: world

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref
2022-04-22 22:18:38 -04:00
committed by GitHub
parent 55d9c8353b
commit 624a54b9cf
25 changed files with 55 additions and 55 deletions

View File

@@ -14,7 +14,7 @@ struct Generic<T: Differentiable & Equatable>: 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)

View File

@@ -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)

View File

@@ -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}}

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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 }

View File

@@ -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

View File

@@ -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 {

View File

@@ -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))
}

View File

@@ -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)!)

View File

@@ -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

View File

@@ -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:

View File

@@ -131,7 +131,7 @@ struct SR9800 {
func foo(_: UnsafePointer<UInt8>) {}
func ambiguityTest(buf: UnsafeMutablePointer<CChar>) {
foo(UnsafePointer(buf)) // this call should be unambiguoius
foo(UnsafePointer(buf)) // this call should be unambiguous
}
}

View File

@@ -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<UInt8>] = [0..<2, 1..<3, 2..<4, 3..<5]
var array = [UInt8](repeating: 0, count: 2)
for range in ranges {

View File

@@ -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: "

View File

@@ -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.

View File

@@ -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.

View File

@@ -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()

View File

@@ -346,10 +346,10 @@ ErrorHandlingTests.test("ErrorHandling/sort") {
forAllPermutations(collection) { sequence in
for i in 0..<sequence.count {
var s = sequence
let throwElment = sequence[i]
let throwElement = sequence[i]
do {
try s.sort { (a, b) throws -> 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..<sequence.count {
let s = sequence
var thrown = false
let throwElment = sequence[i]
let throwElement = sequence[i]
var result: [Int] = []
do {
result = try s.sorted { (a, b) throws -> 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..<sequence.count {
var s = sequence
let throwElment = sequence[i]
let throwElement = sequence[i]
do {
try s.sort { (a, b) throws -> 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..<sequence.count {
let s = sequence
var thrown = false
let throwElment = sequence[i]
let throwElement = sequence[i]
var result: [Int] = []
do {
result = try s.sorted { (a, b) throws -> Bool in
if b == throwElment {
if b == throwElement {
thrown = true
throw SillyError.JazzHands
}

View File

@@ -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))

View File

@@ -134,7 +134,7 @@ OptionSetTests.test("Contains.EmptySet") {
expectFalse(s.contains(.saturday))
}
// Test formItersection()
// Test formIntersection()
OptionSetTests.test("FormIntersection.SingleOption") {
do {

View File

@@ -3762,7 +3762,7 @@ SetTestSuite.test("SetAlgebra.Contains.EmptySet") {
expectFalse(s.contains(1070))
}
// Test formItersection()
// Test formIntersection()
SetTestSuite.test("SetAlgebra.FormIntersection.SingleEntry") {
do {

View File

@@ -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")
]
}

View File

@@ -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

View File

@@ -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: