Commit Graph

2011 Commits

Author SHA1 Message Date
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
practicalswift
d6a7b2f517 [Python] Remove file level Python linting bypass ("noqa") 2016-03-10 13:33:57 +01:00
practicalswift
42b7e3f8d6 Merge pull request #1598 from practicalswift/fix-80-column-violations-in-python-code
[Python] Fix 80 column violations
2016-03-10 10:35:25 +01:00
Dmitri Gribenko
e9796f1c3d Rename UnicodeCodecType to UnicodeCodec in a new test 2016-03-09 18:40:59 -08:00
gregomni
78216b2990 Change all remaining tests that use typealias in a protocol to use associatedtype. 2016-03-09 18:08:52 -08:00
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
Max Moiseev
1fae0d1325 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-08 12:48:48 -08:00
Mike Ferris
7fb274a643 <rdar://problem/24814424> Add unit tests for the error handling support in the XCTest swift overlay 2016-03-08 08:35:24 -08:00
Max Moiseev
7fe6916bf6 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-07 12:10:47 -08:00
practicalswift
4c3bca8e04 [gardening] Fix recently introduced typo: "accidently" → "accidentally" 2016-03-05 08:47:36 +01:00
Michael Gottesman
9a5c3eabf2 Merge pull request #968 from ezephir/linux-validation-dictionary-input
[StdLib] Refactor DictionaryKeyValueTypes test input data
2016-03-04 22:54:42 -08:00
Arnold Schwaighofer
0b181a1861 Don't throw away the top bits of our hashed value for strings on 64bit platforms
SR-877
rdar://24918173
2016-03-04 14:29:02 -08:00
Max Moiseev
cf4bafe9e3 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-03 13:22:03 -08:00
Patrick Pijnappel
49741cfdd9 [stdlib] Rewrite UTF8 decoding 2016-03-03 23:30:00 +11:00
practicalswift
e33f1747a9 [Python] Improve Python consistency: "variable in function should be lowercase" (N806)
The repo contains roughly 80 Python scripts. "snake_case" naming is used for
local variables in all those scripts. This is the form recommended by the PEP 8
naming recommendations (Python Software Foundation) and typically associated
with idiomatic Python code.

However, in nine of the 80 scripts there were at least one instance of
"camelCase" naming prior to this commit.

This commit improves consistency in the Python code base by making sure that
these nine remaining files follow the variable naming convention used for
Python code in the project.

References:
* PEP 8: https://www.python.org/dev/peps/pep-0008/
* pep8-naming: https://pypi.python.org/pypi/pep8-naming
2016-03-02 18:56:47 +01:00
Max Moiseev
859db53d87 Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-03-01 12:56:26 -08:00
Emanuel Zephir
a4e8ee04e0 [StdLib] Refactor DictionaryKeyValueTypes test input data
Split the input file into a pure Swift and Objective-C interop files in
anticipation of refactoring tests to remove XFAILs on Linux.
2016-02-29 22:49:35 -08:00
practicalswift
f6d6585ee0 [Python] Improve Python consistency: Use function_name(…) throughout (PEP8) 2016-02-29 22:49:19 +01:00
Dmitri Gribenko
56785e81a6 Merge pull request #1477 from PatrickPijnappel/patch-3
[stdlib] Rewrite UTF8._isValidUTF8()
2016-02-29 13:12:24 -08: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
Chris Lattner
0aebc5da16 My diagnstics change agitated a validation test, grr. 2016-02-28 21:09:27 -08:00
Patrick Pijnappel
902443e526 [stdlib] Fix _isValidUTF8 tests 2016-02-29 08:05:41 +11:00
Patrick Pijnappel
e02d7e7350 [stdlib] Add tests for _isValidUTF8()
Replaces the tests for the removed _numTrailingBytes()
2016-02-28 22:18:21 +11:00
Daniel Duan
2bc78b8c09 [stdlib] update for 'inout' adjustment (SE-0031) 2016-02-26 12:02:29 -08:00
Dmitri Gribenko
a77104d459 Update tests after transcode() API changes 2016-02-25 20:31:23 -08:00
Dmitri Gribenko
836e7785f9 stdlib: UTF16.measure() => .transcodedLength() 2016-02-25 15:06:00 -08:00
Jordan Rose
b319e3da32 stdlib: Adjust to insert(contentsOf:at:) and append(contentsOf:)
instead of insertContents(of:at:) and appendContents(of:),
originally insertContentsOf(_:at:) and appendContentsOf(_:)
per internal discussion.
2016-02-25 12:50:39 -08:00
Jordan Rose
e4e9c71d8f StdlibUnittest: Rename enum cases and static vars to match API guidelines. 2016-02-24 18:23:59 -08:00
Jordan Rose
f922084180 stdlib: Rename miscellaneous enum cases and static vars. 2016-02-24 17:46:14 -08:00
Jordan Rose
e45dfe09c6 stdlib: Rename 'Native'/'Cocoa' representations inside Dictionary/Set.
...and then because of a compiler bug (SR-806), rename the helper
properties to 'asNative' and 'asCocoa'.

None of this is API, so there is no migration information.
2016-02-24 17:46:12 -08:00
Jordan Rose
979e4a8e34 stdlib: Rename {Float,Double.CGFloat}.NaN to 'nan'
This follows the API guidelines and is consistent with the printed form.
'quietNaN' does not change, though.
2016-02-24 17:46:12 -08:00
Dmitri Gribenko
f3389273ba stdlib: String indices: samePositionIn(_:) => samePosition(in:) 2016-02-24 16:29:27 -08:00
Chris Willmore
2ddb6106e4 stdlib: Audit API for Swift 3 preposition, first-arg label rules
This commit is the result of auditing the following files:

* StringBuffer.swift
* StringCharacterView.swift
* StringCore.swift
* StringInterpolation.swift.gyb
* StringLegacy.swift
2016-02-24 16:11:20 -08:00
Max Moiseev
bb3eaaf308 Merging in latest master 2016-02-24 15:10:25 -08:00
Max Moiseev
0490e86d01 [stdlib] strideTo/strideThrough => stride(to:...)/stride(through:...) 2016-02-24 09:56:10 -08:00