We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13ef2a0 commit 928a557Copy full SHA for 928a557
stdlib/public/core/ASCII.swift
@@ -30,7 +30,7 @@ extension Unicode.ASCII: Unicode.Encoding {
30
@inline(__always)
31
@inlinable
32
public static func _isScalar(_ x: CodeUnit) -> Bool {
33
- return true
+ return isASCII(x)
34
}
35
36
test/stdlib/Unicode.swift
@@ -110,4 +110,12 @@ UnicodeAPIs.test("UTF-8 and UTF-16 queries") {
110
111
112
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
121
runAllTests()
0 commit comments