Commit Graph

99 Commits

Author SHA1 Message Date
Roman Podymov
87a0b0e30b
Tests for the functions that are using KeyPath require !swift(>=5.2) (Thenable) 2020-01-14 22:03:22 +01:00
Roman Podymov
98e3f1cd28
Tests for the functions that are using KeyPath require !swift(>=5.2) (Guarantee) 2020-01-14 22:02:07 +01:00
Roman Podymov
9ea7d3daed
Fixed tests ordering 2020-01-08 22:26:55 +01:00
Roman Podymov
bf293b7395
New items in GuaranteeTests and ThenableTests 2020-01-08 21:17:06 +01:00
Roman Podymov
15a73f95cd
Tests for new mapping functions 2020-01-08 21:15:05 +01:00
Roman Podymov
35379bb8a0
struct Person and tests for new mapping functions 2020-01-08 21:12:41 +01:00
Roman Podymov
f8a593a320 Map by keyPath (#1118)
* Added func map<U>(_ keyPath: KeyPath<T, U>)

* Added swift version

* Added func map<U>(_ keyPath: KeyPath<T, U>)

* testMap

* testMap for Guarantee

* Added missing __allTests__GuaranteeTests

* Added all missing tests

* Removed #if swift

* Tests ordering

* Fixed tests
2020-01-07 17:02:16 +00:00
emrcftci
c864814c1d refactor(*): Change empty tuples to Void 2019-11-13 08:54:47 +03:00
Roman Podymov
10a10ed8bd Promise.value and Guarantee.value when T == Void (#1096)
* Promise.value when T == Void

* Guarantee.value where T == Void

* Replace class with static because Promise is final

* Optimised Guarantee.value where Value == Void

* Add comment

* Implementation with Void()

* Tests for Promise<Void>.value

* Tests for Guarantee<Void>.value

* Added tests for Promise<Void> and Guarantee<Void>
2019-09-25 13:24:39 -04:00
Igor Palaguta
7d3028e0ee update test manifest 2019-06-17 23:36:58 +02:00
Igor Palaguta
9f9f1f9e89 Add guarantee sequence utils 2019-06-17 17:45:55 +02:00
Max Howell
6cfdb23235 Use Swift 5 to generate linuxmain 2019-04-07 13:01:20 -04:00
Max Howell
65c42e2e13
Xcode 10.2 / Swift 5 support
Note we had to bump the Xcodeproj to Swift 4, which is thew new minimum that is supported for Xcode 10.2.

This will affect Carthage users.
2019-01-29 13:34:21 -05:00
Max Howell
7d5d5352e6
Validate that Linux has full test coverage 2019-01-23 22:46:11 -05:00
repo-ranger[bot]
c531710216
Merge pull request #991 from mxcl/fixes-990
Reverts #963 due to ambiguity (see #990)
2019-01-23 23:01:25 +00:00
Max Howell
1c958cfdb6
Reverts #963 due to ambiguity (see #990) 2019-01-23 17:19:00 -05:00
Neal Lester
ecb719a441 Log when unfulfilled guarantee is deallocated
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event.
* Now logs if a Guarantee is deallocated before it has been fulfilled.
2019-01-23 14:04:53 -05:00
Neal Lester
5bb2aae8cc Fixed bug where pendingPromiseDeallocated event was incorrectly repor… (#972)
* Fixed bug where pendingPromiseDeallocated event was incorrectly reported as a waitOnMainThread event. Added test which should have caught this bug in the first place.

* Kick Travis CI
2018-12-14 16:47:17 +00:00
Max Howell
5b72d28396 Rename loggingClosure to logHandler
This is more consistent with Apple API naming.
2018-12-04 15:01:48 -05:00
Neal Lester
a5ab1ea5b3 Added facilities for controlling console output
Refs #961
2018-12-04 14:48:58 -05:00
Max Howell
4e78705bac Keep code-coverage up; Keep docs coverage up 2018-11-29 12:54:13 -05:00
Max Howell
c7dad79d1b
Fix travis (#912)
Actually run the tests for the ones we want them
2018-08-19 14:44:46 -04:00
Max Howell
efcccf58a0 More tests for finally(on:); Tag 6.3.2 2018-06-15 12:26:20 -04:00
mayurdzk
4b4b30e19a Accept a queue in finally() 2018-06-15 21:17:48 +05:30
Max Howell
f846058c3a Fix tests on Linux 2018-06-10 17:57:14 -04:00
Max Howell
d427b29dd7 Allow specifying DispatchWorkItemFlags; Tag 6.3.0
This has recently become useful to me, though this is for experienced users only.
2018-06-10 13:24:26 -04:00
Derek Clarkson
5f7f09f56f Updating test to wait for results 2018-06-10 18:28:04 +10:00
Derek Clarkson
89c58298a1 Guarantee then map 2018-06-09 22:27:00 +10:00
Max Howell
c667ec78cc Add ensureThen
Couldn’t have two variants of `ensure` without the dreaded ambiguity issues.

Sadly Swift cannot infer the type for multiline closures where there are two possible functions for it to match. :(
2018-04-19 21:43:12 -04:00
Max Howell
63a57e4039 Increase Thenable coverage all the way up 2018-02-22 16:17:51 -05:00
Max Howell
9152012f56 Test AnyPromise.result 2018-02-22 11:59:22 -05:00
Max Howell
9acd098b49 Rename some tests 2018-02-22 11:59:22 -05:00
Max Howell
0f538f2684 Fix tests on Linux 2018-02-21 14:36:29 -05:00
Max Howell
c18f2d83fb Delete unused tests; Support swift test
Get travis to runs tests.

Means we no longer support Swift 3.1 on Linux. Sorry. Progress, etc.
2018-02-20 20:08:25 -05:00
Max Howell
c8f747f861 Code coverage improvements
Also enables warnings in tests again and silences the warnings.

Also stops us testing code coverage for tests during CI.
2018-02-20 17:54:59 -05:00
Max Howell
7f7bb7f52d Fix: builds failing, but leaving green lights
Well great. This series of fixes, fixes builds failing but looking like they passed, and fixes the issues that were failing.

Fortunately it was just compile issues in the tests, no tests were failing.

For me this proves that YAML sucks, BASH sucks and TRAVIS sucks.
2018-02-19 15:56:29 -05:00
Max Howell
b9fb8aef4f Provide PMKRace(); Closes #696 2018-02-13 15:50:52 -05:00
Max Howell
1339ca0695 Rewrite AnyPromise to use composition
Our existing hack broke the new Xcode build system (see #724).

Also, CocoaPods 1.4 didn’t like it.

So I had to rewrite with composition instead adding additional methods via an objc category.

The cause of the issue was that the framework required that the -Swift.h file be generated before the objc portions were built (since the objc extended the swift portion), and neither build system guarantees this.

All tests pass. However it is not as efficient as before. Could use some optimizations.
2018-02-12 15:27:50 -05:00
Max Howell
17587be4ac PromiseKit 6.0.0
This because `Promise(value:)` is selected for PMK-4’s pending initializer due to trailing closure syntax and the fact that `T` could be anything. I guess this isn’t a Swift bug, but geez.

This is a real problem for people migrating to 5 from 4, such that I have decided 5 must be deprecated.

The severity is due to Swift giving a very misleading error diagnostic when it uses `Promise(value:)`, because as you can guess you end up with:

    Promise<(T->Void, Error->Void)>

As your inferred type.

Because we no longer have ambiguity between `Promise { seal in` and `Promise(value:` I have removed the `.pending` parameter for that usage which will also aid migration.

In some cases this leads to less nice code, but mostly it’s fine due to being able to do `.value(1)` where `Promise` can be inferred. The trade off is worth it though as PromiseKit should be delightful to use and as it stands, it is a pain due to how Swift is.
2018-02-10 17:23:27 -05:00
Alexander
4742e2ec0f Pure-swift hang() and tests. (#741)
* Pure-swift hang() and tests.

* Tweak hang() to assume Apple-y platforms
2017-12-08 17:16:50 -05:00
Max Howell
47367f1df6 5.0.0 2017-11-06 09:27:11 -05:00
Max Howell
b1dd2bf874 Support Swift 4 and its (()) requirements :-/ 2017-08-07 17:51:03 -04:00
Max Howell
275c5ee2be Don’t try to test Promise() before Swift 3.1 2017-07-15 17:41:28 -04:00
Max Howell
93c237b3a0 Merge pull request #682 from maguro/after
Add DispatchTimeInterval to after() function
2017-07-11 11:05:44 -04:00
Max Howell
3e96afda3f Add Promise(); thanks Swift 3.1
Refs #631
2017-07-10 21:45:18 -04:00
Max Howell
a89fe37356 Support Swift 4 alongside Swift 3
I wish I could configure Travis to run both. Probably I can… not sure how and any effort to do anything with Travis is MANY WASTED DAYS.
2017-07-10 21:27:30 -04:00
Alan D. Cabrera
9395635cfb Add DispatchTimeInterval to after() function
While the use of TimeInterval is understandable from the perspective
of maintaining parity with the Objective-C function PMKAfter, it's not
quite as strongly typed as DispatchTimeInterval.  Also, what's really
going on is a dispatch after a deadline and so support for both seconds
and DispatchTimeInterval seem warranted.
2017-07-09 12:05:43 -07:00
Igor Makarov
db8d5df6f6 expand the ObjC AnyPromise interface by adding -catchOn, -catchInBackground, -catchOnWithPoilcy + add 2 tests for the new methods 2017-06-08 14:36:28 +03:00
Max Howell
279bd386d8 Swift 3.1 --warning 2017-04-24 11:48:30 -04:00
Max Howell
8ea0bf560c Fix failing test on Mac 2017-01-26 12:57:52 -05:00