Commit Graph

3290 Commits

Author SHA1 Message Date
Ben Barham
205d68849e [Test] Filter further C++ standard library symbols
Filters out further standard library symbols:
  - `basic_string::_M_replace`
  - `basic_string::reserve`
  - `basic_string::_M_mutate`
  - `basic_string std::operator+`
2023-02-02 13:06:54 -08:00
Karoy Lorentey
1bc3f797fe [test][NFC] Fix typo 2023-01-30 17:17:16 -08:00
Karoy Lorentey
108bc0e7b2 [stdlib] Add String._isIdentical(to:)
rdar://104828814
2023-01-30 12:08:35 -08:00
swift-ci
e0b16dbdf4 Merge remote-tracking branch 'origin/main' into rebranch 2023-01-25 16:07:15 -08:00
Valeriy Van
d2ad33ae93 test/stdlib: Fix memory leak in UnsafeRawBufferPointer test (#63182) 2023-01-25 09:37:16 +00:00
swift-ci
a69d7575ae Merge remote-tracking branch 'origin/main' into rebranch 2023-01-17 13:33:34 -08:00
swift-ci
03a15ddde8 Merge pull request #63032 from glessard/pr41608-followup
[test] add an omitted test
2023-01-17 13:17:05 -08:00
swift-ci
0d45a8816c Merge remote-tracking branch 'origin/main' into rebranch 2023-01-16 18:33:28 -08:00
Karoy Lorentey
1241df3fab [stdlib] String.debugDescription: Fix quoting behavior
`String.debugDescription` currently fails to protect the contents of
the string from combining with the opening or closing `”` characters
or one of the characters of a quoted scalar:

```swift
let s = “\u{301}A\n\u{302}B\u{70F}”
print(s.debugDescription)
// ⟹ “́A\n̂B܏”  (characters: “́, A, \, n̂, B, ܏”)
```

This can make debug output difficult to read, as string contents are
allowed to spread over and pollute neighboring meta-characters.

This change fixes this by force-quoting the problematic scalars in
these cases:

```swift
let s = “\u{301}A\n\u{302}B\u{70F}”
print(s.debugDescription)
// ⟹ “\u{301}A\n\u{302}B\u{70F}”
```

Of course, Unicode scalars that don’t engage in such behavior are
still allowed to pass through unchanged:

```swift
let s = “Cafe\u{301}”
print(s.debugDescription)
// ⟹ “Café”
```
2023-01-16 01:15:39 -08:00
Erik Eckstein
7ee2c105d5 tests: disable floating point conversion tests for the x86_64 simulator
There is a problem with 16-bit floating point conversions.

rdar://104232602
2023-01-16 09:58:23 +01:00
Guillaume Lessard
e346e24e3f [test] add an omitted test 2023-01-12 15:05:44 -08:00
Alexis Laferrière
4507307b35 Merge pull request #62982 from xymus/deser-safety-step2
[Serialization] Misc prep for the deserialization safety feature
2023-01-12 13:42:28 -08:00
Alexis Laferrière
32abd32ab3 [Test] Disable deserialization safety in test breaking access control 2023-01-11 15:11:11 -08:00
Karoy Lorentey
3f808f7311 Merge pull request #62897 from lorentey/character-recognizer-conformances
[stdlib] _CharacterRecognizer: Add Sendable, Equatable, CustomStringConvertible conformances
2023-01-09 11:33:23 -08:00
Ben Rimmington
2f8751c1ac [SE-0368] StaticBigInt: reorganize test methods (#62915) 2023-01-09 07:07:30 +00:00
Karoy Lorentey
2f1ed631e2 [stdlib] _CharacterRecognizer: Add Sendable, Equatable, CustomStringConvertible conformances
Equatability allows faster implementations for updating cached grapheme boundary state after a text mutation, because it enables quick detection of before/after state equality, without having to feed the recognizers until they produce a synchronized grapheme break.

The CustomStringConvertible conformance makes it orders of magnitude more pleasant to debug code that uses this.

Sendable is a baseline requirement for value types these days.
2023-01-06 14:51:37 -08:00
Karoy Lorentey
67f049ed10 [test] Reenable stdlib/StringIndex, requiring optimized_stdlib 2023-01-06 13:13:03 -08:00
Karoy Lorentey
2f0eab7fbf [test] Disable test/stdlib/StringIndex.swift to unblock CI 2023-01-05 17:45:26 -08:00
Karoy Lorentey
c94556165e Merge pull request #62794 from lorentey/character-recognizer
[stdlib] Export grapheme breaking facility
2023-01-04 23:54:48 -08:00
Karoy Lorentey
d358ece41d Merge pull request #62798 from lorentey/string-index-rounding
[stdlib] Expose index rounding entry points
2023-01-04 21:24:32 -08:00
Karoy Lorentey
4ffc5fe737 Merge pull request #62717 from lorentey/string-utf16-speedup
[stdlib] Speed up short UTF-16 distance calculations
2023-01-04 21:20:41 -08:00
Karoy Lorentey
fa2f63cae0 [stdlib] _CharacterRecognizer._firstBreak(inUncheckedUnsafeUTF8Buffer:startingAt:) 2023-01-03 21:00:01 -08:00
Karoy Lorentey
87422e5dc4 [stdlib] _CharacterRecognizer: Remove initializer argument 2023-01-03 20:59:24 -08:00
Stephen Canon
701a03b41e Remove prefix+ from StaticBigInt (#62733)
* Remove prefix+ from StaticBigInt

This operator causes source breakage in cases like:
```
let a:Int = 7
let b = +1
let c = a + b  // Error: Cannot convert `b` from `StaticBigInt` to `Int`
```
2023-01-03 19:30:01 -05:00
Karoy Lorentey
cd550160a1 [test] Cleanup 2023-01-03 16:08:14 -08:00
Karoy Lorentey
8cd86a2dac Merge pull request #62799 from lorentey/reenable-string-test
[test] Fix and reenable a Substring.removeSubrange test
2023-01-03 13:48:47 -08:00
Ben Rimmington
236829265d [SE-0368] StaticBigInt: Fix test failures (#62746)
<rdar://103369837>
2023-01-03 21:21:21 +00:00
Karoy Lorentey
051f9ede46 [test] String.UTF16View: Add some basic collection tests
Evidently we did not have any tests that exercised
`distance(from:to:)` and `index(_:offsetBy:)`. :-O
2023-01-01 20:58:24 -08:00
Karoy Lorentey
9dd7475d88 [test] Fix and reenable a Substring.removeSubrange test 2022-12-31 17:58:26 -08:00
Karoy Lorentey
f8b997b068 [test] Add tests for string index rounding 2022-12-31 17:42:35 -08:00
Karoy Lorentey
55583ac13c [stdlib] Add new SPI for grapheme breaking (outside String)
`Unicode._CharacterRecognizer` is a newly exported opaque type that
exposes the stdlib’s extended grapheme cluster breaking facility,
independent of `String`.

This essentially makes the underlying simple state machine public,
without exposing any of the (unstable) Unicode details.

The ability to perform grapheme breaking over, say, the scalars stored
in multiple `String` values can be extremely useful while building
custom text processing algorithms and data structures.

Ideally this would eventually become API, but before proposing this
to Swift Evolution, I’d like to prove the shape of the type in actual
use (and we’ll also need to find better names for its operations).
2022-12-30 16:32:01 -08:00
Karoy Lorentey
4d9edad297 [test] Improve grapheme breaking tests
Instead of just checking the number of breaks in each test case,
expose and check the actual positions of those breaks, too.
2022-12-29 17:56:45 -08:00
Alexis Laferrière
cb435c2104 [Test] Disable stdlib/StaticBigInt on macOS 2022-12-15 13:38:05 -08:00
Alexis Laferrière
bba52dd26c [Test] Disable StaticBigInt test on watchOS 2022-12-14 16:05:27 -08:00
Mishal Shah
45d6cb04ac Disable NSSlowTaggedLocalizedString.swift
This test started failing in Xcode 14.1 with macOS 12.6
2022-12-14 10:02:14 -08:00
Ben Rimmington
0b29450a3d [SE-0368] StaticBigInt (#40722) 2022-12-06 21:59:42 +00:00
Jonathan Grynspan
e057172b6f Make _swift_willThrow atomic (#62349)
* Make _swift_willThrow atomic
2022-12-03 10:41:56 -05:00
Alsey Coleman Miller
62b7be4e9c [stdlib] Add RISCV64 support 2022-11-01 23:59:42 -07:00
Nate Chandler
c9d86eed75 [Freestanding] Disable child task priority spec.
Under the task-to-thread model, specifying a priority doesn't make
sense.

Here, variations of addTask and addTaskUnlessCancelled are introduced
which do not take a priority.  Additionally, the original functions are
made unavailable.
2022-10-18 11:25:10 -07:00
Nate Chandler
fa82280337 [Freestanding] Disable AsyncStream. 2022-10-18 11:25:10 -07:00
Nate Chandler
cbaa1b14c8 [Freestanding] Disable Task.sleep. 2022-10-18 11:25:10 -07:00
David Smith
3292f4e97e Separate out ASCII and UTF8 in NSString accessors, and use the ASCII one where we really need ASCII (#61086)
Separate out ASCII and UTF8 in NSString accessors, and use the ASCII one where we really need ASCII
2022-09-23 12:31:45 -07:00
Anthony Latsis
ccb2e047bd Merge pull request #60951 from AnthonyLatsis/migrate-test-suite-to-gh-issues-22
Gardening: Migrate test suite to GH issues p. 22
2022-09-22 20:21:31 +03:00
Anthony Latsis
52ce15ee9d Gardening: Migrate test suite to GH issues: stdlib 2022-09-22 03:21:39 +03:00
swift-ci
b28efc557d Merge pull request #61117 from apple/revert-60790-rdar99047747
Revert "[Freestanding] Disable checked continuations."
2022-09-21 11:06:49 -07:00
Drew Maxwell
7825221cd4 Updating Swift tests to remove outdated tests and use more current calls. 2022-09-16 15:11:10 -07:00
nate-chandler
9a7c0b9869 Revert "[Freestanding] Disable checked continuations." 2022-09-14 17:29:49 -07:00
Mike Ash
7f6c565c07 [Test] Add new symbol to symbol-visibility-linux.test-sh.
Add `_ZNSt6vectorISsSaISsEE17_M_realloc_insertIJSsEEEvN9__gnu_cxx17__normal_iteratorIPSsS1_EEDpOT_`, which is a slight variation on one of the existing ignored symbols for std::vector::_M_realloc_insert.

rdar://99888061
2022-09-14 14:04:16 -04:00
Ben Pious
57d82317c1 Add CustomDebugDescription conformance to AnyKeyPath (#60133)
* initial

* it works

demangling mostly works

fix dots

printing works

add tests

add conformance to AnyKeyPath

implement SPI

subscripts fully work

comments

use cross platform image inspection

remove unnecessary comment

fix

fix issues

add conditional conformance

add types

try to fix the api-digester test

cr feedback: move impls behind flag, remove addChain(), switch statement, fallthrough instead of if-elses, move import

cr feedback: refactor switch statement

fix #ifdef

reindent, cr feedback: removes manual memory management

fix missing whitespace

fix typo

fix indentation issues

switch to regexes

checks should test in on all platforms

print types in subscripts

add test for empty subscript

Update test/api-digester/stability-stdlib-abi-without-asserts.test

Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>

add commas

fix failing test

fix stdlib annotation

cr feedback: remove global, refactor ifdef

cr feedback: switch back to manual memory management

switch to 5.8 macro

add new weakly linked functions to the allowlist

fix one more failing test

more cr feedback

more cr feedback

* fix invisible unicode
2022-09-13 09:23:32 -07:00
Alejandro Alonso
bff02ddfbd Disable a test in StringIndex
update

add code
2022-09-08 09:18:18 -07:00