Skip to content

Commit

Permalink
Adjust to tink_stream#simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinresol committed Jul 17, 2021
1 parent 45f7042 commit 20d4bf4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions haxe_libraries/tink_core.hxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @install: lix --silent download "gh://github.com/haxetink/tink_core#abee932c4e724517090238b6527eac28874c0354" into tink_core/1.27.1/github/abee932c4e724517090238b6527eac28874c0354
-cp ${HAXE_LIBCACHE}/tink_core/1.27.1/github/abee932c4e724517090238b6527eac28874c0354/src
-D tink_core=1.27.1
# @install: lix --silent download "gh://github.com/haxetink/tink_core#641f4fdd7c559a3069d59a0056d6c0ce06499b57" into tink_core/2.0.2/github/641f4fdd7c559a3069d59a0056d6c0ce06499b57
-cp ${HAXE_LIBCACHE}/tink_core/2.0.2/github/641f4fdd7c559a3069d59a0056d6c0ce06499b57/src
-D tink_core=2.0.2
8 changes: 3 additions & 5 deletions haxe_libraries/tink_streams.hxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# @install: lix --silent download "gh://github.com/haxetink/tink_streams#5066a96c4a8b483479b6a8df8893eaf8922d3bea" into tink_streams/0.4.0/github/5066a96c4a8b483479b6a8df8893eaf8922d3bea
# @install: lix --silent download "gh://github.com/haxetink/tink_streams#f4478825ef0a30df1187f02a354ec61176b47b8b" into tink_streams/0.3.3/github/f4478825ef0a30df1187f02a354ec61176b47b8b
-lib tink_core
-cp ${HAXE_LIBCACHE}/tink_streams/0.4.0/github/5066a96c4a8b483479b6a8df8893eaf8922d3bea/src
-D tink_streams=0.4.0
# temp for development, delete this file when pure branch merged
-D pure
-cp ${HAXE_LIBCACHE}/tink_streams/0.3.3/github/f4478825ef0a30df1187f02a354ec61176b47b8b/src
-D tink_streams=0.3.3
12 changes: 7 additions & 5 deletions src/tink/testrunner/Assertions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ abstract Assertions(Impl) from Impl to Impl {

@:from
public static function ofSurpriseAssertion(p:Surprise<Assertion, Error>):Assertions {
return Stream.future(p.map(function(o):Stream<Dynamic, Dynamic> return switch o {
case Success(a): Stream.single(a);
case Failure(e): Stream.ofError(e);
}));
return ofPromiseAssertion(p);
}

@:from
public static inline function ofPromiseAssertion(p:Promise<Assertion>):Assertions {
return Stream.promise(p.next(assertion -> Stream.single(assertion)));
}

@:from
Expand All @@ -51,7 +53,7 @@ abstract Assertions(Impl) from Impl to Impl {

@:from
public static inline function ofPromiseAssertions(p:Promise<Assertions>):Assertions {
return ofSurpriseAssertions(p);
return Stream.promise(p);
}

@:from
Expand Down
8 changes: 4 additions & 4 deletions src/tink/testrunner/Runner.hx
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ class Runner {
var assertions = [];
return caze.execute().forEach(function(a) {
assertions.push(a);
return reporter.report(Assertion(a)).map(function(_) return Resume);
return reporter.report(Assertion(a)).swap(None);
})
.next(function(o):Outcome<Array<Assertion>, Error> return switch o {
case Depleted: Success(assertions);
case Halted(_): throw 'unreachable';
case Failed(e): Failure(e);
case Done: Success(assertions);
case Stopped(_): throw 'unreachable';
case Failed(_, e): Failure(e);
})
.timeout(caze.timeout, timers);
})
Expand Down

0 comments on commit 20d4bf4

Please sign in to comment.