Commit Graph

44 Commits

Author SHA1 Message Date
Dmitri Gribenko
0e1c488f9a stdlib: print, debugPrint: 'toStream:' => 'to:' 2016-02-15 23:48:02 -08:00
Erik Eckstein
9c25ce1a75 tests: add a few more import statements to workaround linker errors 2016-01-08 15:08:56 -08:00
Arsen Gasparyan
9203f36630 Refactoring 2015-12-24 12:18:59 +03:00
Arsen Gasparyan
a1c0343a98 Share test data between test files 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
11d9be1117 [tests] add import statements to prevent unresolved symbols 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
35b055b346 Split a test file 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
ac3a8a8cd1 Rewrite part #6 of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
ceb1ba7a0b Rewrite part #5 of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
967a5efdb3 Rewrite part #4 of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
dfe3ab511b Rewrite part #3 of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
459b76fae5 Rewrite part #2 of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Arsen Gasparyan
6e104707c9 Rewrite part of file with StdlibUnittest 2015-12-24 11:55:01 +03:00
Wojtek Czekalski
575300e760 Added tests for debug printing of floating point numbers 2015-12-14 19:25:14 +01:00
Wojtek Czekalski
3a9eec6692 Fixed debugPrintedIs assertion logic in Print.swift
They didn't fail if expected2 was nil (nil was default value) but the actual value was different than expected1
2015-12-14 19:25:14 +01:00
Arsen Gasparyan
52890e5c30 Replace if true {} with do {} 2015-12-13 10:54:54 +03:00
David Farler
9aa7663ad3 Always debugPrint containers' elements
rdar://problem/19312992

Swift SVN r31067
2015-08-07 06:14:19 +00:00
Joe Pamer
828eb68e72 Commit DaveA's API changes to 'print', along with the compiler changes necessary to support them.
There's still work left to do. In terms of next steps, there's still rdar://problem/22126141, which covers removing the 'workaround' overloads for print (that prevent bogus overload resolution failures), as well as providing a decent diagnostic when users invoke print with 'appendNewline'.

Swift SVN r30976
2015-08-04 01:57:11 +00:00
Dmitri Hrybenko
f5de8757e4 stdlib: remove Word and UWord
These types are leftovers from the early pre-1.0 times when Int and UInt
were always 64-bit on all platforms.  They serve no useful purpose
today.  Int and UInt are defined to be word-sized and should be used
instead.

rdar://18693488

Swift SVN r30564
2015-07-24 05:01:32 +00:00
Joe Groff
db0fea590e stdlib: Use unqualified names in 'print'.
Leave the qualification off of enum cases and type names when 'print'-ing them, but keep them on 'debugPrint'. (At least, at the outermost level; since ad-hoc printing of structs and tuples uses debugPrint, we'll still get qualification at depth, which kind of sucks but needs more invasive state management in print to make possible.) Implements rdar://problem/21788604.

Swift SVN r30166
2015-07-13 21:42:11 +00:00
Arnold Schwaighofer
f7771859d8 Rename the optimize_test feature to executable_test and document that feature.
Swift SVN r29213
2015-06-01 23:44:13 +00:00
Arnold Schwaighofer
3643c614a3 Run tests in optimize test modes
This runs all files that have a target-build-swift or target-run-stdlib-swift
RUN line in optimize test mode.

Swift SVN r29206
2015-06-01 21:23:31 +00:00
Enrico Granata
8a5726d966 Revert 28997
The consensus is against this change and we're going for a much more targeted fix in PlaygroundLogger only



Swift SVN r28999
2015-05-24 23:16:57 +00:00
Enrico Granata
05a038e818 Make it so that the runtime demangler does not print the Swift standard library module name
This changes things like Swift.Dictionary<Swift.Int, Swift.AnyObject> to Dictionary<Int, AnyObject>

It has been suggested that playgrounds would benefit from not showing the fully qualified name.
Playgrounds use the runtime demangler to obtain type names, and honestly, I do not see enough value in those qualifiers being printed out to justify hackery in PlaygroundLogger or separate demangling logic



Swift SVN r28997
2015-05-24 22:25:12 +00:00
Ted Kremenek
42cccf07b2 Make CFunctionPointer, GeneratorOf, SequenceOf unavailable.
Implements rdar://problem/20477688

Swift SVN r28459
2015-05-12 06:28:02 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00
Dmitri Hrybenko
a03680e7fd stdlib: print struct members, in addition to the type name
Swift SVN r27250
2015-04-13 07:22:36 +00:00
Dmitri Hrybenko
5bb6490636 stdlib: when doing ad-hoc printing, use the debug representation
Swift SVN r27249
2015-04-13 06:04:13 +00:00
Dave Abrahams
ac3f047496 [stdlib] Renaming fallout from Mirror API review
toString(x)      => String(x)
toDebugString(x) => String(reflecting: x)
Printable        => CustomStringConvertible
DebugPrintable   => CustomDebugStringConvertible

Also updated comments to clarify these protocols

Swift SVN r27090
2015-04-07 20:32:26 +00:00
Dmitri Hrybenko
ff2dd6320a stdlib: fix coding style
When colon specifies is-a relationship between types, we put spaces on
both sides of the colon.

Swift SVN r27016
2015-04-05 05:54:55 +00:00
Chris Lattner
56bf85cc5f fix <rdar://problem/19874152> Swift 1.2 struct memberwise initializer violates new sanctity of previously set let property
If a non-static 'let' field in a struct has an initializer, its implicitly generated
memberwise initializer should not override that.  Handle this by having the memberwise initializer
and default initializer use the initial value of the property instead of an argument to the init.

This would have been a lot easier if sema was synthesizing the ctor bodies instead of SILGen,
but here it is.  The missing case is narrow (let (x,y) = (1,2)) and for now we just disable
implicit synthesization of the incorrect case.



Swift SVN r25424
2015-02-20 07:26:57 +00:00
Dmitri Hrybenko
3d388293f8 stdlib: debugPrint() of a Character should produce a quoted string
rdar://19299944

Swift SVN r25237
2015-02-12 11:26:04 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Dmitri Hrybenko
1437427edf Add a test for toString() on metatypes
rdar://16954373

Swift SVN r24794
2015-01-28 06:52:54 +00:00
Dmitri Hrybenko
363a953de0 tests: fix tests not to overflow an Int on 32-bit platforms
Swift SVN r24786
2015-01-28 05:22:40 +00:00
David Farler
280d212c78 Set: print different forms for description and debugDescription
Set.description now prints its array literal form, and
Set.debugDescription prints its initializer form. Both print
the debugDescription of the members.

Set([1,2,3]).description = "[2, 3, 1]"
Set([1,2,3]).debugDescription = "Set([2, 3, 1])"

rdar://problem/19312961

Swift SVN r24306
2015-01-09 10:09:40 +00:00
David Farler
8c19f452e5 Update test expectation for printing Set<String>
Swift SVN r24025
2014-12-19 01:26:32 +00:00
David Farler
1766dd71ed Use Set([...]) as Set's description, debugPrint elements
Don't use {. . .} as Set's description - use:

Set([1, 2, 3]) and debugPrint the elements.

rdar://problem/19299943

Swift SVN r24021
2014-12-19 00:01:38 +00:00
Joe Groff
ee5adc1f6e Runtime: Provide reflection for metatypes.
Metatypes have no user-visible structure, but can at least summarize as their type names. This gives us reasonable ad-hoc Printable behavior (thought debugPrint is still wrong, since a type name isn't parsable without being .self'ed).

Swift SVN r23745
2014-12-05 22:58:44 +00:00
David Farler
e7506e8eab Remove underscore from _Set<T>
rdar://problem/19132138

Make Set<T> visible by removing the underscore. Also, remove the pesky
${_Self} gyb variable that was for a temporary convenience in hiding Set.

Swift SVN r23699
2014-12-05 00:21:35 +00:00
David Farler
d0718c69fc Prefix Set<T> with underscore for API development
Swift SVN r23263
2014-11-12 07:07:01 +00:00
David Farler
c453eb4c48 Add Set type.
<rdar://problem/14661754> TLF: [data-structure] Set<T> data type + Bridging from NSSet

Swift SVN r23262
2014-11-12 07:07:00 +00:00
Maxwell Swadling
963619cdc1 [stdlib] C_ARG{c,v} renamed to argc/unsafeArgv
Fixes rdar://problem/17229052
Make it clear C_ARGV var is unsafe.
Made it impossible to set the argc/unsafeArgv outside of the stdlib.
Refactored tests to not use C_ARG{C,V}.
Made C_ARG{C,V} unavailable.

Swift SVN r23249
2014-11-11 22:34:49 +00:00
Jordan Rose
e83c117c30 [test] Hack: run stdlib tests first to start long-running tests earlier.
This decreases total testing time by over a minute on my old Mac Pro.
It probably has much less effect on systems with fewer cores, but shouldn't
be any worse there.

Swift SVN r22745
2014-10-15 01:30:51 +00:00