Commit Graph

1996 Commits

Author SHA1 Message Date
Han Sangjin
5c1854bfcf stdlib: Portable random function
Changed rand32() implementation using a random engine in C++11 <random>.
2016-03-31 04:39:46 +09:00
Dmitri Gribenko
3e8ffae660 New indexing model: update the test generator for Slice* tests 2016-03-29 17:34:03 -07:00
Max Moiseev
c93fcb98ae [stdlib][swift-3-indexing-model] fixing Concatenate tests
The 'reversed' tests are marked as XFAILing, because required methods
are not implemented on `ReversedCollection`.
2016-03-29 14:56:22 -07:00
Dave Abrahams
8e4f85277b Merge remote-tracking branch 'refs/remotes/origin/master' into merge 2016-03-29 09:19:34 -07:00
Dave Abrahams
97baefffc7 Fix up use of limitedBy: in a test 2016-03-28 17:07:53 -07:00
Dave Abrahams
eda98cddde Spelling error: s/Avance/Advance/ 2016-03-28 17:07:53 -07:00
Dave Abrahams
cfcc21e395 Update successor/predecessor in validation tests 2016-03-28 17:07:52 -07:00
Dave Abrahams
393ca5d362 Warning suppression 2016-03-28 17:07:52 -07:00
Dave Abrahams
a5c3c63c3d [stdlib] Indexing model: nix RangeOfStrideable
Instead, use CountableRange which is constrained to have a Strideable
Bound whose Stride conforms to Integer.
2016-03-28 17:06:09 -07:00
Dave Abrahams
a95cea9868 Merge branch 'swift-3-indexing-model' of github.com:apple/swift into swift-3-indexing-model 2016-03-28 13:35:30 -07:00
Dave Abrahams
da5c4036ac func index(n: IndexDistance, stepsFrom i: Index)
M-x findr-query-replace

\<func advance(\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,[
]*\)by \([^(),]*\|[^(),]+([^()]*)[^(),]*\)

func index(\3\2stepsFrom \1
2016-03-28 13:23:04 -07:00
Dave Abrahams
81d3e8ca83 limit: => limitedBy:, pt 2
M-x findr-query-replace

\<limit: \([^(),]*\|[^(),]+([^()]*)[^(),]*\))\( *\(?:[^ -]\|-[^>]\)\)

limitedBy: \1)\2
2016-03-28 13:12:02 -07:00
Ted Kremenek
3c988c7d25 Remove fixed seed, as apparently it causes a crash. Will investigate more. 2016-03-26 09:17:38 -07:00
Ted Kremenek
a2d775401e Fix seed in Hashing.swift test. 2016-03-26 08:57:41 -07:00
Ted Kremenek
19b0a09f05 Try to *really* disable tests by moving them out of the same folder. 2016-03-26 08:20:37 -07:00
Ted Kremenek
dcc093f179 Try and disable these two tests for real. 2016-03-26 07:55:41 -07:00
Dave Abrahams
01127b32d5 index(n, stepsFrom: i)
M-x findr-query-replace

\<advance(\([^:]+?\),\([
]+\)by: *\([^(),]*\|[^(),]+([^()]*)[^(),]*\)\(,\(?:[
]+\)limit: *\(?:[^()]*\|[^()]+([^()]*)[^()]*\)\)?)

index(\3,\2stepsFrom: \1\4)
2016-03-25 17:54:39 -07:00
practicalswift
d00a5ef814 [gardening] Weekly gardening: typos, duplicate includes, header formatting, etc. 2016-03-24 22:41:10 +01:00
Max Moiseev
e7511620cf [stdlib][swift-3-indexing-model] adding a tag to find and fix the skipped test later 2016-03-24 10:24:25 -07:00
Max Moiseev
d721a03d90 [stdlib][swift-3-indexing-model] fixing Index tests 2016-03-23 16:07:20 -07:00
Dave Abrahams
8d9e62b274 [stdlib] indexing model: rename next/previous
I'm not too satisfied with the names for the updating: versions, but
this is a start.
2016-03-22 17:13:54 -07:00
Max Moiseev
303ddac014 [stdlib][swift-3-indexing-model] fixing ExistentialCollection tests 2016-03-22 16:18:15 -07:00
Max Moiseev
6e76935b33 [stdlib][swift-3-indexing-model] fixing more tests
Algorithm and SequenceWrapperTest
2016-03-22 15:04:29 -07:00
Dmitri Gribenko
168e7e41a5 Merge pull request #1525 from PatrickPijnappel/utf8-rewrite
[stdlib] Rewrite UTF8 decoding
2016-03-22 14:24:11 -07:00
Max Moiseev
5713a6b608 [stdlib][swift-3-indexing-model] fixing stdlib/Generator tests 2016-03-22 12:42:33 -07:00
Max Moiseev
a43a46c8ba [stdlib][swift-3-indexing-model] making Dictionary validation tests pass 2016-03-22 12:05:22 -07:00
Max Moiseev
cf92a80830 [stdlib][swift-3-indexing-model] making Set validation tests pass 2016-03-22 11:57:05 -07:00
Dmitri Gribenko
8f48d85d9e Array tests: split Objective-C-independent tests into a new file
And also merge the small test/1_stdlib/ArrayCore.swift test into it.
2016-03-21 23:27:03 -07:00
Dmitri Gribenko
a6cd57222a Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-21 14:41:15 -07:00
Arsen Gasparyan
9dbf4c99c8 Replace if true with do 2016-03-21 23:01:48 +03:00
Ted Kremenek
b6104b9cae Disable "Hashing.swift" test since it fails with some non-zero probability even when the functionality is correct.
This is causing the the test to be largely ignored, and disrupts regular testing
(including in continuous integration) where an integration can fail just
because this tests fails for "expected" reasons.

We should re-enable the test once it is has a way to tolerate the
"expected" failure, perhaps using some notion of statistical confidence
to determine if the failure is real.
2016-03-19 21:27:44 -07:00
Dmitri Gribenko
8ef59b187d Silence warnings in NewArray.swift.gyb 2016-03-19 18:07:58 -07:00
Dmitri Gribenko
3f448b3896 Move NewArray.swift.gyb to validation-test
It depends on checkRangeReplaceable, which was moved to
StdlibCollectionUnittest.
2016-03-19 18:07:50 -07:00
Dmitri Gribenko
aaa486cc7b New indexing model: fix most compilation issues in StdlibCollectionUnittest
We are still hitting what looks like a compiler bug:

error: type alias 'SubSequence' circularly references itself

which is emitted for every minimal collection type.
2016-03-18 23:20:57 -07:00
Dmitri Gribenko
941235c25e New indexing model: remove a duplicate API 2016-03-18 23:03:19 -07:00
Jordan Rose
40f57149f6 Move StdlibUnittest tests to their own directory.
StdlibUnittest.swift became StdlibUnittest/Common.swift;
all others just dropped the "StdlibUnittest" prefix.
2016-03-18 16:19:30 -07:00
Jordan Rose
e6a519fbda [StdlibUnittest] Install our own handler for uncaught ObjC exceptions.
We don't want to be at the whims of the system on what to do with an
uncaught exception; we need to make sure its message gets printed to
stderr so that the parent process can check it.

(There's a bit of trickery here to see if the class looks like an
NSException; otherwise we lose the name of the exception and just get
the reason.)
2016-03-18 13:55:45 -07:00
Doug Gregor
d92ae77076 Eliminate most remaining uses of _convertNSFooToFoo and _convertFooToNSFoo.
Generalized bridging has fully subsumed most of these. NSError is
still special, and _convertStringToNSString remains for the the
runtime's implementation of SwiftObject's -description method.
2016-03-18 11:42:00 -07:00
Harlan Haskins
47541c92b4 [StdlibUnittest] Made output for expected crashes less fatalistic 2016-03-17 18:23:41 -06:00
Max Moiseev
03cbb49982 [stdlib] _stdlibAssert => _debugPrecondition 2016-03-17 12:16:19 -07:00
Dave Abrahams
f493b54e44 [stdlib] indexing model: Interval/Range merge
This is step 1; we still need to introduce ClosedRange.
2016-03-16 15:59:10 -07:00
Ben Langmuir
d22638766e Swap the order of arguments to expectEqual in Hashing test
So that we print "expected" and "actual" on the correct values if it
fails.
2016-03-16 11:32:48 -07:00
Ben Langmuir
24f685c1d2 Decrease the probability that stdlib/Hashing.swift will fail
Bump the number of trials from 10 to 14, which makes the test orders of
magnitude less likely to fail.  For a range of size 10, doing 10 trials
meant that a single call to checkRange would fail ~0.03% of the time;
with 14 trials the spurious failure rate is ~0.0003%. We have 10 calls
to checkRange in this test with ranges of size <= 10.

While this test didn't fail that often before, we have a very large
number of automated builds and it has been a constant low-level source
of friction that this test fails and we have to look at and then ignore
the results.
2016-03-16 11:29:43 -07:00
Dmitri Gribenko
85d955b788 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-15 01:27:03 -07:00
practicalswift
1edb62dc38 [Python] Make flake8 linting pass without errors/warning (w/ default rules) 2016-03-13 20:19:51 +01:00
Patrick Pijnappel
4d05dc69a1 [stdlib] Resolve merge conflict in Unicode.swift 2016-03-13 14:08:23 +11:00
Dmitri Gribenko
3cde854287 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-03-12 01:11:32 -08:00
Slava Pestov
55519871e0 validation-tests: Don't use AnyObject dispatch in Dictionary.swift
Fixes <rdar://problem/25023473>.
2016-03-11 13:25:54 -08:00
Dmitri Gribenko
d268da0628 New indexing model: avoid allocations in fatalError() when the string buffer is already in UTF-8 2016-03-11 13:08:01 -08:00
practicalswift
7b1fd47f93 [Python] Make slice tests output identical to pre-cleanup outputs
In order to avoid introducing unnecessary diffs.
2016-03-10 19:48:12 +01:00