File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 22//
33// This source file is part of the Swift.org open source project
44//
5- // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+ // Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
66// Licensed under Apache License v2.0 with Runtime Library Exception
77//
88// See https://swift.org/LICENSE.txt for license information
@@ -30,7 +30,7 @@ extension Unicode.ASCII: Unicode.Encoding {
3030 @inline ( __always)
3131 @inlinable
3232 public static func _isScalar( _ x: CodeUnit ) -> Bool {
33- return true
33+ return isASCII ( x )
3434 }
3535
3636 @inline ( __always)
Original file line number Diff line number Diff line change @@ -110,4 +110,12 @@ UnicodeAPIs.test("UTF-8 and UTF-16 queries") {
110110 }
111111}
112112
113+
114+ UnicodeAPIs . test ( " ASCII._isScalar " ) {
115+ expectTrue ( ASCII . _isScalar ( 0 ) )
116+ expectTrue ( ASCII . _isScalar ( 0x7F ) )
117+ expectFalse ( ASCII . _isScalar ( 0x80 ) )
118+ expectFalse ( ASCII . _isScalar ( 0xFF ) )
119+ }
120+
113121runAllTests ( )
You can’t perform that action at this time.
0 commit comments