Commit Graph

120 Commits

Author SHA1 Message Date
Dave Abrahams
ce804529a1 [stdlib] Dump _StringStorage.grow()
This implementation detail was adding lots of needless complexity
2017-05-31 16:12:22 -07:00
Max Moiseev
178b9f0b44 [stdlib] Adding bounds check in a.subscript(Index) fast path
UnsafeBufferPoiunter subscript used in the fast path only checks bounds
in Debug mode, therefore extra checks are needed.

Addresses: <rdar://problem/31992473>
2017-05-05 15:26:24 -07:00
Graydon Hoare
badf215b82 Use .skip rather than .xfail on unknown-cause stdlib String test (rdar://31992473) 2017-05-05 11:06:45 -07:00
Maxim Moiseev
b93dd6602e XFAILing the String test to fix the build 2017-05-05 10:38:50 -07:00
ben-cohen
a7def4bba9 Delete old unused String._splitFirst 2017-04-30 06:04:15 -07:00
Max Moiseev
8ffbc81239 Fixing some validation tests 2017-03-10 17:09:28 -08:00
Syo Ikeda
e2b03a98dd [gardening] Prefer Array(seq) over seq.map { $0 } 2017-02-04 10:37:22 +09:00
ben-cohen
ce0d713cd6 fixed where clauses, Optional-as-Any and unused vars 2016-12-29 07:58:12 -08:00
Dmitri Gribenko
243a35cd65 Migrate callsites from 'expectEmpty()' to 'expectNil()' 2016-09-10 20:05:42 -07:00
Doug Gregor
b9363fe6bd [SE-0111] Enable SE-0111 by default. 2016-07-29 17:28:24 -07:00
Rintaro Ishizaki
c6f4bcd01e [SE-0101] MemoryLayout: Migrate testsuite and benchmarks 2016-07-30 03:11:45 +09:00
Robert Widmann
35fe7c7ad6 Cleanup validation tests after SE-0089 2016-07-28 18:01:44 -07:00
Roman Levenstein
8ea999e19f Fix a failing test 2016-07-26 23:30:06 -07:00
Michael Gottesman
3b7a5c6dd8 Disable test while Roman is looking into it to fix the build.
rdar://17028332
2016-07-26 23:07:18 -07:00
swiftix
9756755e68 Merge pull request #3758 from swiftix/SE-130-implementation
Implementation of the SE-130 proposal.
2016-07-26 22:15:13 -07:00
Roman Levenstein
a798852cb4 Implementation of the SE-130 proposal.
It replaces String initializers taking Character or UnicodeScalar as a repeating value by a more general initializer that takes a String as a repeating value. This is done to avoid the ambiguities in the current String API, which can be only resolved by explicit casting.
String.append(_:UnicodeScalar) APIs is also removed to match these changes.
2016-07-26 20:08:11 -07:00
Xin Tong
9709b0e510 Merge pull request #3662 from trentxintong/unicodescalar
SE-0128 - Change unicodescalar initializer to failable
2016-07-26 16:44:14 -07:00
Arnold Schwaighofer
39389b9c09 [SE-0125] Remove isUniquelyReferenced and the NonObjectiveCBase class
We can express the same using the `isUniquelyReferencedNonObjC` API.

- Rename `isUniquelyReferencedNonObjC` to `isKnownUniquelyReferenced`.
- Cleanup `ManagedBufferPointer` by removing holdsUniqueOrPinnedReference` and
  renaming `holdsUniqueReference` to `isUniqueReference`.
- No longer promise to return false from `isKnownUniquelyReferenced` for @objc
  class instances.

SR-1962
rdar://21886410
2016-07-26 07:09:29 -07:00
Xin Tong
bbf86865d6 Change unicodescalar to failable
We were using a precondition which crashes the program when invalid input is
provided. We want to provide a way to gracefully check and handle invalid input
or shutdown the program if necessary.

SR-1930
2016-07-21 15:27:13 -07:00
Alexander Lash
9a4caf6c4b [core] hasPrefix/hasSuffix consider the empty string a prefix/suffix of all strings. 2016-07-20 17:46:47 -07:00
Dmitri Gribenko
1d3f595955 stdlib: re-enable validation-test/stdlib/String.swift 2016-07-15 20:33:47 -07:00
Michael Gottesman
16143ca41f Disable test to unbreak the build.
rdar://27381049
2016-07-15 15:08:54 -07:00
Dmitri Gribenko
ce94bd9cca Merge pull request #3268 from natecook1000/nc-scalarindex-nocore
[stdlib] Remove _StringCore from UnicodeScalarIndex
2016-07-07 17:41:36 -07:00
Philippe Hausler
9b421c77ac Testing fallout for fixing SR-1903 2016-07-05 13:11:53 -07:00
Nate Cook
202f84e7f4 [stdlib] Update String COW tests
Removing the _StringCore reference from string indices fixes
an extra reallocation when mutating a string with heap buffer
storage.
2016-07-02 23:16:28 -05:00
Saleem Abdulrasool
83901998c9 Port for PS4
Add support for the PS4 OS.  Update the standard library and add a target unit
test.
2016-06-30 20:14:50 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Austin Zheng
240460ba38 Adding tests for String's removeSubrange overloads 2016-06-08 09:35:14 -07:00
Austin Zheng
30ba084a70 Adding tests for String's replaceSubrange overloads for closed ranges 2016-06-08 01:01:00 -07:00
Austin Zheng
f92be08556 Adding tests for String's replaceSubrange overloads for non-closed ranges 2016-06-07 17:01:39 -07:00
Maxim Moiseev
38f7ec2a32 [stdlib] Fix the String.decodeCString for UTF16 and UTF32 (#2681)
[stdlib] Fix the `String.decodeCString` for UTF16 and UTF32

Resolves [SR-1578](https://bugs.swift.org/browse/SR-1578]
Essentially the problem was that `strlen` is not the right way of
obtaining a length of anything but null-terminated UTF-8 sequence of
characters. Other encodings require alternative mechanisms.
2016-05-25 15:51:10 -07:00
Maxim Moiseev
eb7c39b4f9 [stdlib] Add String.subscript(_: ClosedRange<Index>) (#2653)
Fixes [SR-1596](https://bugs.swift.org/browse/SR-1596).
2016-05-24 11:35:07 -07:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dmitri Gribenko
b75d2b9df4 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-25 13:50:09 -07:00
Brian Gesiak
38741f3928 [test] Add Android (and FreeBSD) to OS checks
Add Android to the OS checks used to determine whether to import Glibc.
These tests would pass on Android were it not for the fact that Android is not
included in the Glibc check.

Also add FreeBSD where missing.
2016-04-25 10:58:32 -04:00
Dmitri Gribenko
fc39950543 Remove an empty test 2016-04-22 16:35:00 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Austin Zheng
ac9049cbe6 Manually rebasing string diagnostic tests from @shawnce PR 1688 2016-04-18 17:52:56 -07:00
Dmitri Gribenko
fc8d62dfbb Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-18 14:40:06 -07:00
practicalswift
db452dcbe9 [gardening] "[ a, b ]" → "[a, b]" 2016-04-17 21:26:08 +02:00
practicalswift
c2107f456c [gardening] "[ a, b ]" → "[a, b]" (#2227) 2016-04-17 21:02:18 +02:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
Max Moiseev
fee941fc00 [stdlib][swift-3-indexing-model] fixing usages of successor/predecessor that have recently became internal 2016-04-08 17:03:29 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Dmitri Gribenko
3e8dd1fa7c New indexing model: fix the validation-test/stdlib/String.swift test 2016-04-04 15:43:29 -07:00
Dmitri Gribenko
6985b958fd Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-04 11:42:17 -07:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Dave Abrahams
cfcc21e395 Update successor/predecessor in validation tests 2016-03-28 17:07:52 -07:00
Max Moiseev
e48f452a2e Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-api-guidelines 2016-02-29 12:15:33 -08:00
Max Moiseev
a49dab6bf8 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-29 12:08:52 -08:00