Commit Graph

275 Commits

Author SHA1 Message Date
Austin Zheng
51f19eafdf [stdlib] Adding new indices model tests (#2991)
* [stdlib] Adding new tests for collection indices

Changes:
- Added tests for 'index(next:)'
- Added tests for all 'formIndex' API variants
- Modified existing tests to better test bidirectional collections

* Fixes reflecting review feedback
2016-06-16 10:53:47 -07:00
Brian Gesiak
328de9e280 [SR-1738] add_swift_library takes SHARED/STATIC arg
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.

Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
2016-06-16 13:15:58 -04:00
Austin Zheng
4872e546b0 [stdlib] Adding tests for removeSubrange overloads for range types 2016-06-14 23:57:49 -07:00
Austin Zheng
6042ee0244 [gardening] Add .self to suppress compiler warnings 2016-06-14 18:24:29 -07:00
practicalswift
c74273dfd1 [gardening] Remove "-*- swift -*-" from non-.gyb file. 2016-06-12 19:03:54 +02:00
practicalswift
13e7e8db87 [gardening] Fix recently introduced header. 2016-06-08 09:40:10 +02:00
Austin Zheng
fa6c028edf Adding tests for replaceSubrange overloads for range types (#2774) 2016-06-07 14:21:30 -07:00
swift-ci
7c98b492e8 Merge pull request #2841 from ahoppen/SR-1236-tests-update 2016-06-02 11:38:34 -07:00
Alex Hoppen
2108a235df [Tests] Update existing tests for the upcoming implementation of SE-0036 2016-06-02 17:50:55 +02:00
rintaro ishizaki
6401324993 [stdlib] Apply tail style "where" clause to stdlib/{internal,private} 2016-06-02 12:01:21 +09:00
Dmitri Gribenko
a1e73a6b0d CMake: remove dead code 2016-05-31 21:57:07 -07:00
Dmitri Gribenko
296e2ae835 stdlib: implement reverse() as proposed in SE-0078 2016-05-24 00:37:28 -07:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
Dmitri Gribenko
b7984be446 stdlib: always check that IteratorProtocol.next() repeatedly returns nil
This is required by SE-0052.
2016-05-15 23:55:48 -07:00
Russ Bishop
da3f51fa26 Fix LoggingWrappers 2016-05-15 15:07:12 -07:00
Russ Bishop
1f88150b79 Use forEach() and fix tests 2016-05-14 23:32:41 -07:00
Russ Bishop
f20c9255e9 Changes for code review 2016-05-14 16:57:00 -07:00
Russ Bishop
1d8edfa60f SR-1519: Add Sequence.first(predicate:) 2016-05-13 23:46:05 -07:00
Maxim Moiseev
5fe2a0232e [stdlib] Introducing MinimalStrideableIndex... (#2506)
... as well as new test collection types:
`MinimalRandomAccessCollectionWithStrideableIndex` and
`DefaultedRandonAccessCollectionWithStrideableIndex`, to test default
implementation of `index(...)` family of functions provided by the
standard library for the random access collections with strideable
indices.
2016-05-13 11:19:46 -07:00
Trent Nadeau
0cc851568a Updated tests to use @discardableResult and _ = . 2016-05-11 22:53:38 -04:00
Ted Kremenek
942e524285 Revert "SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations" (#2477) 2016-05-11 11:02:37 -07:00
Jordan Rose
14a7334aef Merge pull request #2224: SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations
from @ahoppen
2016-05-10 19:58:09 -07:00
Dmitri Gribenko
32605a19d9 StdlibCollectionUnittest: MinimalIterator: allow multiple nil returns
SE-0052 requires all iterators to return nil indefinitely after all
elements have been consumed.
2016-05-10 14:16:22 -07:00
Alex Hoppen
0e8c69c56f [SE-0036]: Requiring Leading Dot Prefixes for Enum Instance Member Implementations 2016-05-07 22:39:26 +02:00
practicalswift
c262b42ae0 [gardening] Fix recently introduced whitespace typos. (#2443) 2016-05-06 23:49:39 -07:00
practicalswift
68b148cfb1 [gardening] Fix recently introduced typos. 2016-05-06 20:31:38 +02:00
Dave Abrahams
93dfc16626 [stdlib] More reliably avoid running duplicate tests
Removing the “checksAdded” parameter from collection unit tests and
simply sharing a global variable is a better way to go.  We don't
use threads at that level, so there's no thread safety issue, and we
already committed to globals when we introduced the logging wrappers.
2016-05-02 15:30:29 -07:00
Dave Abrahams
446657459f [stdlib] index(...) tests => StdlibCollectionUnittest
Moving the ones that can be applied generally into the unit testing
library.
2016-05-01 14:00:24 -07:00
Max Moiseev
d00dddbdab [stdlib][swift-3-indexing-model] fixing the ReversedCollection/lazy test 2016-04-29 13:46:50 -07:00
Austin Zheng
e034946b45 Fixing index(where:) API test
Changes:
- Fixed a bug in the collection unit test exercising the index(where:) API
- Reenabled relevant LazyMapCollection tests
2016-04-28 20:04:39 -07:00
Dmitri Gribenko
50a3662cc3 StdlibCollectionUnittest: remove a protocol that had only one user 2016-04-28 14:57:52 -07:00
Dave Abrahams
9bee5d182f [stdlib] location/formLocation => index/formIndex 2016-04-26 17:46:16 -07:00
Dmitri Gribenko
5ec4252a56 stdlib: fix warnings and indentation 2016-04-26 11:15:35 -07:00
Dave Abrahams
73647eff56 [stdlib] Start gybbing CollectionUnitTest.swift 2016-04-22 17:59:58 -07:00
Dave Abrahams
17cb21ea7e [stdlib] Move some test resources to StdlibCollectionUnittest 2016-04-22 17:59:58 -07:00
Dave Abrahams
66472fadcd [stdlib] Reindent / fix 80-column violations 2016-04-22 16:09:10 -07:00
Max Moiseev
e1104af665 [stdlib][swift-3-indexing-model] rephrasing doc comments 2016-04-22 13: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
Dave Abrahams
adb8ade39a [stdlib] Fix some test names.
The names of the corresponding methods changed a while ago.
2016-04-21 13:09:41 -07:00
Dmitri Gribenko
fc8d62dfbb Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-18 14:40:06 -07:00
Dmitri Gribenko
3e23907f13 stdlib: fix warnings about deprecated @noescape and @autoclosure syntax 2016-04-18 14:07:23 -07:00
practicalswift
db452dcbe9 [gardening] "[ a, b ]" → "[a, b]" 2016-04-17 21:26:08 +02:00
Dmitri Gribenko
2b35fea059 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-16 00:30:12 -07:00
Chris Lattner
4fd8418ba7 move the stdlib to put noescape and autoclosure on the type, instead of
the parameter.  Progress towards SE-0049.
2016-04-14 23:13:43 -07: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
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
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