Commit Graph

15 Commits

Author SHA1 Message Date
Karoy Lorentey
81567ed85e [Foundation] CharacterSet: Modernize hashing 2019-04-05 18:07:26 -07:00
Gregory Todd Williams
09ed106f25 [stdlib] Don't try to construct invalid UnicodeScalars in CharacterSet
Inserting and removing a single Unicode.Scalar in a CharacterSet must not
attempt to create a Range<Unicode.Scalar> because the upperBound value might
not always be a valid UnicodeScalar.

This fixes a regression to the fix for SR-2988.
2018-01-02 10:07:28 -08:00
Michael Ilseman
75c476b984 Revert "Add Codable conformance to common Foundation types"
This reverts commit dee889f4d0.
2017-05-17 11:56:31 -07:00
Itai Ferber
dee889f4d0 Add Codable conformance to common Foundation types
Add conformances + unit tests for
* CGFloat
* AffineTransform
* Calendar
* CharacterSet
* DateComponents
* DateInterval
* Decimal
* IndexPath
* IndexSet
* Locale
* Measurement
* NSRange
* PersonNameComponents
* TimeZone
* URL
* UUID

along with some unit tests for each.
2017-05-16 16:57:46 -07:00
Philippe Hausler
5b4d913a54 Merge branch 'master' into correct_unconditionally_bridge 2017-05-01 15:17:36 -07:00
Erik Eckstein
43ecc02397 Disable a failing test.
rdar://problem/31746923
2017-04-20 16:44:45 -07:00
Philippe Hausler
138644f1e3 [Foundation] Add unit tests for unconditional bridging and import a few unit tests for Decimal 2017-04-18 10:09:39 -07:00
Philippe Hausler
6c26b80e6e [Foundation] Rework the backing storage for CharacterSet to be more performant and bridge correctly to objective-c and CF
Some cases of using isSuperset can cause crashes, this was caused by improper subclassing callouts; this pr resolves those failures (and provides unit tests for that case)
The cases where the bridge was traversed too much now only causes a single bridge out call (without needing to reallocate or thrash retain/release)
String.components(separatedBy: CharacterSet) should be considerably faster now not only for more apporpriate bridging calls but also no longer needing to bridge arrays back and forth.

Resolves the following issues:
rdar://problem/17281998
rdar://problem/26611771
rdar://problem/29738989
2017-03-31 11:06:38 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Greg Parker
5001ee4645 Revert "Test and Fix: subset and superset for empty character set" (#6021) 2016-12-01 20:26:10 -08:00
MuhammadAnnaqeeb
e41a29a11c Fix subset and superset for empty character set (#6000)
Fix isSubset() and isSuperset() involving the empty CharacterSet.
2016-12-01 14:43:25 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Janek Spaderna
d5e1819416 [stdlib] Don't try to construct invalid UnicodeScalars
When inserting a closed range/creating a CharacterSet from a closed
range we must not try to convert this range to a half open one by
incrementing the upperBound UnicodeScalar because not all integer values
are valid values for UnicodeScalar

Fixes SR-2988
2016-11-02 12:20:31 +01:00
Xiaodi Wu
7041b4b2bf [SR-2503] Implement subtraction for CharacterSet (#5201)
* Implement CharacterSet.subtracting(_:)

* Add test for CharacterSet.subtract(_:)

* Expand on test for CharacterSet.subtract(_:)

* Address reviewer comment (CharacterSet tests)

* Improve documentation for CharacterSet set algebra
2016-10-11 15:26:56 -07:00
Max Moiseev
9fc37efee4 [test] renaming test/1_stdlib to just test/stdlib 2016-09-01 16:51:43 -07:00