Commit Graph

1996 Commits

Author SHA1 Message Date
Max Moiseev
5da3e1dab3 [test] Fix validation tests 2017-07-26 16:49:14 -07:00
Dave Abrahams
41c53ae729 [stdlib] Give Substring its own views
This necessary for ensuring the property that String doesn't keep
inaccessible memory alive.  For example, before this change,

    String(s.dropFirst().unicodeScalars)

would compile and produce a String that owned inaccessible memory.
Now it no longer compiles.

String's view's SubSequences are the same as the Substring's
view. E.g. String.UnicodeScalarView.SubSequence is
Substring.UnicodeScalarView.

New compatibility inits added, to work around the fact that many
previously failable initializers are now non-failable.
2017-07-26 15:59:51 -07:00
Dave Abrahams
1f1f35a57b [stdlib] Squash some warnings in a test 2017-07-26 15:59:12 -07:00
Max Moiseev
1c3e597928 [stdlib] Get rid of ArithmeticOverflow type 2017-07-26 11:09:36 -07:00
Maxim Moiseev
a5ff35cd41 [stdlib] extendingOrTruncating: => truncatingIfNeeded: 2017-07-26 11:09:36 -07:00
swift-ci
4d5dfdd42c Merge pull request #10966 from rintaro/stdlib-hashedcollection-switchcase 2017-07-24 00:51:08 -07:00
Michael Gottesman
ec5a92fd04 Disable some tests this time for real. 2017-07-21 13:14:18 -07:00
Michael Gottesman
ab6a4f5249 Disable some failing tests.
rdar://33358110
2017-07-19 16:25:39 -07:00
Dave Abrahams
e6519fbd2b [stdlib] Make String.UTF8View bidirectional
This is a step along the way toward handling backward-compatiblity of UTF8View
slicing and preventing inadvertent creation of String instances that keep
inaccessible memory alive.
2017-07-17 13:53:45 -07:00
Ling Wang
7946bb3872 Add tests for utf8-to-utf8 index conversion 2017-07-15 12:33:00 -05:00
Rintaro Ishizaki
d2eab3c342 [stdlib] Use #if guarded switch case
_Cocoa{Set,Dictionary}{Buffer,Index,Iterator} can be completely
eliminated from non-ObjC runtime environments.
2017-07-14 18:14:34 +09:00
Brian Croom
f788a309ff Stop swallowing test interruption exceptions thrown during XCTAssert evaluation.
Rethrow any test interruption exceptions that get caught, mirroring the
behavior of the Objective-C XCTAssert macros.

<rdar://problem/33255447>
2017-07-12 12:28:34 -07:00
Dave Abrahams
9159239995 Un-revert "[stdlib] String index interchange, etc." (#10812)
I failed to merge the upstream changes to swift-corelibs-foundation at the same
time as I merged that #9806, and it broke on linux. Going to get it right this
time.
2017-07-07 12:13:25 -07:00
Xi Ge
d9fb110674 Revert "[stdlib] String index interchange, etc." (#10812)
rdar://33186295
2017-07-07 12:03:16 -07:00
Dave Abrahams
a2db6059b4 [stdlib] Extend String index conversion tests for interchange
test the new APIs as well as the legacy failing conversions.
2017-07-07 06:15:27 -07:00
Dave Abrahams
8485de6307 [stdlib] Drop a couple bogus duplicate tests
Only the last of each set of dups gets run anyway.  See
https://bugs.swift.org/browse/SR-5362
2017-07-07 06:15:27 -07:00
Dave Abrahams
73f116e9de [stdlib] Fix a test: String.UTF8View has its own Iterator now 2017-07-07 06:15:25 -07:00
Dave Abrahams
b1d2f4c68e [stdlib] String index interchange, part III (UTF8) 2017-07-07 06:15:24 -07:00
Dave Abrahams
2e0bb2f533 [stdlib] String index interchange, part II (UTF16) 2017-07-07 06:15:23 -07:00
Dave Abrahams
e523c80339 [stdlib] Index interchange, part I 2017-07-07 00:59:04 -07:00
Andrew Trick
609cd23131 Foundation.Data unit tests: enable standard Collection semantics tests. 2017-07-06 10:01:03 -07:00
Max Moiseev
0913206f29 [tests] Generate LazyMap tests from the template 2017-07-05 16:53:58 -07:00
Max Moiseev
02eca4abd7 [tests] Add template for LazyMap tests 2017-07-05 16:53:58 -07:00
Max Moiseev
e2c22b2425 [tests] Re-generate files from the template 2017-07-05 15:51:08 -07:00
Max Moiseev
7730c60705 [tests] Split collection tests further for more even load on executors 2017-07-05 15:51:08 -07:00
Arnold Schwaighofer
1214f04757 Fix Lazy.swift.gyb in optimize test mode
EmptyCollection was changed a while ago to use _debugPrecondition checks in the
accesses being tested that fail in optimize mode. Change the test to only expect
a failure in debug mode.

rdar://31897334
2017-06-30 08:48:20 -07:00
Max Moiseev
46af654271 [overlay] Add ModelIO overlay 2017-06-26 10:56:13 -07:00
Philippe Hausler
c358afe655 [Foundation] Adjust Double and Float bridges to be more lenient 2017-06-16 15:18:27 -07:00
Jordan Rose
7295423339 Revert "Re-enable Lazy validation test." (#10330)
The test is still failing on some of the Apple-internal builders. Tracked (still) by rdar://problem/31897334.
2017-06-16 13:46:49 -07:00
Mark Lacey
af49a77b28 Re-enable Lazy validation test.
Works for me locally.

Resolves rdar://problem/31897334.
2017-06-16 08:38:29 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Nate Cook
41ea7e296c Merge pull request #10113 from natecook1000/nc-dict-tuples
[stdlib] Add dictionary overloads for merging methods
2017-06-06 14:58:15 -07:00
Nate Cook
a48e7fd954 [stdlib] Test that dictionaries can be passed to merge/merging 2017-06-05 15:54:16 -07:00
Robert Widmann
6509f78f13 tests: replace remaining 'mkdir -p' calls with %empty-directory(...)'
These changes were made manually.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
486cab447d tests: replace 'rm -rf %t && mkdir -p %t' with '%empty-directory(%t)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dave Abrahams
b2e4bd5d09 [stdlib] Replace _HeapBuffer with a thin wrapper
...over ManagedBufferPointer
2017-06-01 04:40:52 -07:00
Dave Abrahams
ce804529a1 [stdlib] Dump _StringStorage.grow()
This implementation detail was adding lots of needless complexity
2017-05-31 16:12:22 -07:00
Ben Cohen
02e2bd5380 Re-gyb sorting (#9818) 2017-05-21 16:59:46 -07:00
Ben Cohen
169f3aed6f Revert "Un-XFAIL Lazy.swift test (#9777)"
This reverts commit f9893a9758.
2017-05-19 11:30:33 -07:00
Ben Cohen
f9893a9758 Un-XFAIL Lazy.swift test (#9777) 2017-05-19 10:03:54 -07:00
Dave Abrahams
fd30b72ee1 [stdlib] Fix a race
Lock-free programming is almost always a bug.
Fixes <rdar://25398370> Data Race in StringBuffer.append (found by TSan)
2017-05-18 16:29:59 -07:00
Doug Gregor
2a9867bf88 [CoreGraphics] Make CGColor adopt _ExpressibleByColorLiteral.
The backflips here are because we cannot add initializers to imported
CF types; they would be factory initializers. Fixes
rdar://problem/32196175.
2017-05-18 09:57:52 -07:00
Mark Lacey
bc7dff5c9f Revert "Re-instate "Improve disjunction selection""
This reverts commit
ecfa406fc5, which was reinstating
3c5b393e0c.

It does not revert one test change from that commit, because
inexplicably one of the tests is still failing, probably due to some
other changes that have happened since. I'm leaving a ticket open to
investigate.

I've added one of the new cases that is failing as a result of this
change.

This is being reverted not because of bugs in this particular commit,
but because it seems to be exposing other bugs in the type checker that
are resulting in source compatibility problems. We need to shake these
other bugs out of the type checker before bringing this change back.
2017-05-15 11:27:11 -07:00
Ben Cohen
ea2f64cad2 [stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match

* Remove many instances of Iterator.

* Fixed various hard-coded tests

* XFAIL a few tests that need further investigation

* Change assoc type for arrayLiteralConvertible

* Mop up remaining "better expressed as a where clause" warnings

* Fix UnicodeDecoders prototype test

* Fix UIntBuffer

* Fix hard-coded Element identifier in CSDiag

* Fix up more tests

* Account for flatMap changes
2017-05-14 06:33:25 -07:00
Nate Cook
f030652cc9 Merge pull request #9462 from natecook1000/nc-dict-keys-compat
[stdlib] Provide Swift 3 compatible Dict.keys/values
2017-05-10 15:37:39 -05:00
Nate Cook
b71e2636c4 Update dictionary tests 2017-05-10 11:27:34 -05:00
Nate Cook
bdcf640b59 Updated tests for Dictionary.keys/values 2017-05-10 10:45:08 -05:00
Jordan Rose
01cb554387 Re-apply "Make all CF types Equatable and Hashable." (#4568)
Like NSObject, CFType has primitive operations CFEqual and CFHash,
so Swift should allow those types to show up in Hashable positions
(like dictionaries). The most general way to do this was to
introduce a new protocol, _CFObject, and then have the importer
automatically make all CF types conform to it.

This did require one additional change: the == implementation that
calls through to CFEqual is in a new CoreFoundation overlay, but the
conformance is in the underlying Clang module. Therefore, operator
lookup for conformances has been changed to look in the overlay for
an imported declaration (if there is one).

This re-applies 361ab62454, reverted in
f50b1e73dc, after a /very/ long interval
where we decided if it was worth breaking people who've added these
conformances on their own. Since the workaround isn't too difficult---
use `#if swift(>=3.2)` to guard the extension introducing the
conformance---it was deemed acceptable.

https://bugs.swift.org/browse/SR-2388
2017-05-08 14:05:11 -07:00
Ben Cohen
f6f3ed0fe7 Add Collection constraints via protocol where clauses (#9374) 2017-05-07 08:55:48 -07:00