Commit Graph

1226 Commits

Author SHA1 Message Date
Max Moiseev
28060f0fdf [stdlib][swift-3-indexing-model] fixing tests for Linux 2016-04-25 16:24:25 -06:00
Dmitri Gribenko
b75d2b9df4 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-25 13:50:09 -07:00
Dave Abrahams
5fcb00364b Merge branch 'swift-3-indexing-model' of github.com:apple/swift into swift-3-indexing-model 2016-04-25 10:54: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
8e886a3bdd stdlib: ranges: remove range protocols
The RangeProtocol was a very weak and fragile abstraction because it
didn't specify the interpretation of the endpoints.  To write a
non-trivial algorithm, one usually needed to consult that information.
The standard library code only actually worked correctly with half-open
and closed ranges (and didn't handle fully open ranges, for example).

The other two protocols, HalfOpenRangeProtocol and ClosedRangeProtocol,
were only used for code sharing, and present an ABI burden.  We can use
gyb instead.
2016-04-22 18:15:06 -07:00
Dave Abrahams
17cb21ea7e [stdlib] Move some test resources to StdlibCollectionUnittest 2016-04-22 17:59:58 -07:00
Dave Abrahams
99ac452766 [stdlib] Test additional limited index movement cases
The cases where the limit was in the opposite direction of the movement
were not being tested.  Also, bring back the explicit expected result.
Some things are not as trivial to compute correctly as they look.
2016-04-22 17:59:54 -07:00
Dmitri Gribenko
fc39950543 Remove an empty test 2016-04-22 16:35:00 -07:00
Dave Abrahams
c099c1a075 [stdlib] More precise testing for traps
Let's only detect the traps we're really interested in.
2016-04-22 16:15:31 -07:00
Dave Abrahams
4e4480ada5 [stdlib] More 80-column cleanups 2016-04-22 16:13:32 -07:00
Dave Abrahams
f9c8f3b69a [stdlib] Add test sanity
A number of factors were making it hard to tell what was being tested
here.  This commit improves naming, and stops explicitly specifying
expected results that can be trivially computed.
2016-04-22 16:09:10 -07:00
Dmitri Gribenko
54d81b6633 Rewrite tests for _copyToNativeArrayBuffer() default implementations to use StdlibCollectionUnittest infrastructure 2016-04-21 18:31:31 -07:00
Dave Abrahams
47a870cc50 [stdlib] Use location/formLocation for all index movement 2016-04-21 17:13:41 -07:00
Dmitri Gribenko
41e94ac655 stdlib: fix a bug in CountableClosedRange._customContainsEquatableElement() and add better tests for range types
The tests are still not thorough enough, but this is a start.
2016-04-21 14:00:18 -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
Michael Gottesman
d89f252deb Merge remote-tracking branch 'origin/master' into master-next 2016-04-18 02:26:06 -07:00
practicalswift
a64a828974 Merge pull request #2228 from practicalswift/brackets-ii
[gardening] "[ a, b ]" → "[a, b]", "\t" → " ", "are are" → "are"
2016-04-17 21:48:01 +02:00
practicalswift
db452dcbe9 [gardening] "[ a, b ]" → "[a, b]" 2016-04-17 21:26:08 +02:00
Chris Lattner
88b70f15c1 stop using obsolete #line syntax. 2016-04-17 12:20:43 -07:00
practicalswift
c2107f456c [gardening] "[ a, b ]" → "[a, b]" (#2227) 2016-04-17 21:02:18 +02:00
Dmitri Gribenko
cfea1a3f58 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-14 17:00:46 -07:00
Dmitri Gribenko
c52787e900 Merge commit '9cdbec13eee72feccfc5f8b987882a8c52e8107b' into swift-3-indexing-model 2016-04-14 16:23:53 -07:00
Dmitri Gribenko
3e708a9328 Merge commit '8e292daec1bc790c96b5ee39b8d55dadcac6ce1b' into swift-3-indexing-model 2016-04-14 15:10:26 -07:00
Dmitri Gribenko
735f1287b0 Merge remote-tracking branch 'origin/swift-3-indexing-model' into swift-3-indexing-model 2016-04-14 14:10:27 -07:00
Dmitri Gribenko
10697f939f Merge commit '510f29abf77e202780c11d5f6c7449313c819030' into swift-3-indexing-model 2016-04-14 13:45:27 -07:00
Doug Gregor
1c571d9631 Disable currently-failing XCTest test covered by rdar://problem/25733187 2016-04-14 13:10:19 -07:00
Max Moiseev
37bf02f7da [stdlib][swift-3-indexing-model] changes in index(_:stepsFrom:limitedBy:)
- index(_:stepsFrom:limitedBy:) returns Index?
- formIndex(_:stepsFrom:limitedBy) returns Bool
2016-04-14 11:49:27 -07:00
practicalswift
dc6c2aeef6 [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 23:03:55 +02:00
Dave Abrahams
1c3d998951 Revert "[gardening] "Type->Type" → "Type -> Type" in Swift code"
This reverts commit 14edeaf67a because
it's breaking tests:
https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastFailedBuild/consoleFull#1361088108ee1a197b-acac-4b17-83cf-a53b95139a76
2016-04-13 10:29:57 -07:00
practicalswift
14edeaf67a [gardening] "Type->Type" → "Type -> Type" in Swift code 2016-04-13 10:51:53 +02:00
Max Moiseev
316c1b088b [stdlib][swift-3-indexing-model] implementing missing methods in Reverse
... and un-xfailing corresponding validation tests.
2016-04-12 16:13:02 -07:00
practicalswift
c760f6dfbf [gardening] Add whitespace: "foo,bar" → "foo, bar" 2016-04-12 22:31:46 +02:00
Jordan Rose
315761c4cf [ClangImporter] Don't assume inner pointers are nullable.
Some inner pointers are explicitly annotated as _Nonnull, and we
should believe that. This is important when passing, say, pointers
to arrays.
2016-04-11 20:06:41 -07:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Max Moiseev
0124bd261f [stdlib][swift-3-indexing-model] un-commenting and un-spliting .lazy usages 2016-04-11 17:58:52 -07:00
Dmitri Gribenko
d52cbab5c2 Merge commit '0ff3239b962218267d37307e53906b31315a1cfc' into swift-3-indexing-model
This commit is the parent of the commit that implemented SE-0046
Establish consistent label behavior across all parameters including
first labels
2016-04-09 16:18:33 -07:00
Dmitri Gribenko
f4987d02ec stdlib: new indexing model: Forward more methods in AnyCollection 2016-04-08 20:29:10 -07:00
Dmitri Gribenko
a200c7ad8e stdlib: new indexing model: implement slicing on AnyCollection 2016-04-08 20:27:44 -07:00
Dmitri Gribenko
9169c37802 Use check*AssociatedTypes() on Set and Dictionary 2016-04-08 18:46:00 -07:00
Dmitri Gribenko
d18775e91d Make ExistentialCollection.swift test slightly easier for the type checker 2016-04-08 17:40:39 -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
Max Moiseev
2e75c815e3 [stdlib][swift-3-indexing-model] speeding up compilation of Concatenate test 2016-04-08 16:44:17 -07:00
Max Moiseev
e6b36434c3 [stdlib][swift-3-indexing-model] fixing ObjectiveC_without_Foundation test 2016-04-08 16:16:54 -07:00
Max Moiseev
1a875cb922 [stdlib][swift-3-indexing-model] speeding up the compilation 2016-04-08 11:06:05 -07:00
Max Moiseev
590f62f3bd [stdlib][swift-3-indexing-model] introducing new LazyCollections
- Instead of just one there are now three:
  - LazyCollection
  - LazyBidirectionalCollection
  - LazyRandomAccessCollection
- ReversedCollection now conforms to BidirectionalCollection
- Lazy tests compile and run (#if'ed pieces that don't typecheck)
2016-04-08 11:06:05 -07:00
Chris Willmore
73d5077bae Add API notes for Foundation following internal Swift 3 naming audit. 2016-04-07 20:35:18 -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
Max Moiseev
b7a1b1d1e0 Revert "[stdlib][swift-3-indexing-model] introducing new LazyCollections"
This reverts commit 5ad441f35a.
2016-04-06 13:07:31 -07:00
Max Moiseev
5ad441f35a [stdlib][swift-3-indexing-model] introducing new LazyCollections
- Instead of just one there are now three:
  - LazyCollection
  - LazyBidirectionalCollection
  - LazyRandomAccessCollection
- ReversedCollection now conforms to BidirectionalCollection
- Lazy tests compile and run (#if'ed pieces that don't typecheck)
2016-04-06 10:11:30 -07:00