Commit Graph

10 Commits

Author SHA1 Message Date
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
practicalswift
fa7fbdb8b0 [gardening] Remove redundant nil-initialization of optional variable
From the Swift documentation:

"If you define an optional variable without providing a default value,
 the variable is automatically set to nil for you."
2016-09-18 07:40:07 +02:00
Austin Zheng
9138b73097 [stdlib] Addressing Dmitri Gribenko's feedback re #2993
Changes:
- Moved only-used-once helper methods into call sites
- Parameterized tests that might expect a crash
- Fixed some comments and formatting; renamed some test helper APIs
2016-06-17 00:26:27 -07:00
Austin Zheng
6231cca609 [stdlib] Implementing O(1) methods on CountableClosedRange (#2993)
* [stdlib] Implementing O(1) methods on `CountableClosedRange`

Changes:
- Implemented O(1) `index(_:offsetBy:)` and `distance(from:to:)` methods on `CountableClosedRange`
- Fixed some unit tests
- Added many more unit tests for Countable*Range index APIs

* Clarify test intent
2016-06-16 21:08:13 -07:00
rintaro ishizaki
4b51d85abb [test] Add %target-run-simple-swiftgyb
* Utilize %target-run-simple-swiftgyb where possible
2016-06-15 11:49:44 +09:00
Rintaro Ishizaki
1bdce7ced6 [lit] Add substitutions: %utils and %line-directive
%utils => ${SWIFT_SOURCE_DIR}/utils
%line-directive => ${SWIFT_SOURCE_DIR}/utils/line-directive
2016-06-11 02:41:15 +09:00
Max Moiseev
14470b11d0 [stdlib] moving the strideable test to where it belongs 2016-05-13 12:25:22 -07:00
Dmitri Gribenko
d2522170ac Fix the Range test in optimized mode 2016-04-26 11:15:49 -07: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
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