Commit Graph

11 Commits

Author SHA1 Message Date
Karoy Lorentey
7ce8544610 [StdlibUnittest] expectEqual: Use less opinionated argument names
Based on its argument names and messages, `expectEqual` and friends expects the expected value of the calculation being tested to be provided as its first argument, and the actual value as the second:

```
expectEqual(4, 2 + 2)
```

This does not always match actual use -- folks like myself find the opposite ordering far more natural:

```
expectEqual(2 + 2, 4)
```

`expectEqual` currently uses the `expected`/`actual` terminology in its failure messages, causing confusion and needless suffering.

Change `expectEqual`'s declaration and error messages to use a naming scheme that does not assume specific roles for the two arguments. (Namely, use `first`/`second` instead of `expected`/`actual`.)

An alternative way to solve this would be to use argument labels, as in `expectEqual(expected: 4, actual: 2 + 2)`, or to introduce some sort of expression builder scheme such as `expect(2 + 2).toEqual(2)`. These seem needlessly fussy and overly clever, respectively.
2022-02-16 14:00:54 -08:00
Saleem Abdulrasool
12c7cead9d test: make the StdlibUnittest.Common pass on Windows
This adjusts the paths in the test to support the Linux and Windows path
separators.  Loosen the test to accept the interleaved stdout output on
Windows.
2019-06-10 12:25:06 -07:00
Maxim Moiseev
16eb32f539 [validation-test] Marking a few stdlibunittest validation tests as unsupported on watchos (#7731) 2017-02-24 13:44:32 -08:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Dmitri Gribenko
c52787e900 Merge commit '9cdbec13eee72feccfc5f8b987882a8c52e8107b' into swift-3-indexing-model 2016-04-14 16:23:53 -07:00
Jordan Rose
bc83940301 Make pointer nullability explicit using Optional.
Implements SE-0055: https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md

- Add NULL as an extra inhabitant of Builtin.RawPointer (currently
  hardcoded to 0 rather than being target-dependent).
- Import non-object pointers as Optional/IUO when nullable/null_unspecified
  (like everything else).
- Change the type checker's *-to-pointer conversions to handle a layer of
  optional.
- Use 'AutoreleasingUnsafeMutablePointer<NSError?>?' as the type of error
  parameters exported to Objective-C.
- Drop NilLiteralConvertible conformance for all pointer types.
- Update the standard library and then all the tests.

I've decided to leave this commit only updating existing tests; any new
tests will come in the following commits. (That may mean some additional
implementation work to follow.)

The other major piece that's missing here is migration. I'm hoping we get
a lot of that with Swift 1.1's work for optional object references, but
I still need to investigate.
2016-04-11 20:06:38 -07:00
Dmitri Gribenko
6985b958fd Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-04 11:42:17 -07:00
Dmitri Gribenko
bad2ff1bb7 StdlibUnittest: add assertions for range checks 2016-04-01 14:12:17 -07:00
Slava Pestov
49c54870c1 Serialization: Auto-linking recursively walks modules imported from -sil-serialize-all modules 2016-04-01 12:21:36 -07:00
Dmitri Gribenko
27e2f7f6d9 StdlibUnittest: new feature: data-parameterized tests 2016-03-31 00:50:10 -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