Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Fix fuzzy arrow warning in lib/testing.dart. (#12)
Browse files Browse the repository at this point in the history
Context: dart-lang/sdk#29630

- fixes a few places to use the real generic method syntax
- bumps version to 0.1.5
  • Loading branch information
munificent authored and jakemac53 committed Nov 3, 2017
1 parent d28530d commit 1e73c04
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.1.5

* Change TestStdinAsync.controller to StreamController<List<int>> (instead of
using dynamic as the type argument).

## 0.1.4

* Added `BazelWorkerDriver` class, which can be used to implement the bazel side
Expand Down
8 changes: 3 additions & 5 deletions lib/testing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class TestStdinSync implements TestStdin {
/// Note: You must call [close] in order for the loop to exit properly.
class TestStdinAsync implements TestStdin {
/// Controls the stream for async delivery of bytes.
final StreamController _controller = new StreamController();
StreamController get controller => _controller;
final StreamController<List<int>> _controller = new StreamController();
StreamController<List<int>> get controller => _controller;

/// Adds all the [bytes] to this stream.
void addInputBytes(List<int> bytes) {
Expand All @@ -67,9 +67,7 @@ class TestStdinAsync implements TestStdin {
StreamSubscription<List<int>> listen(onData(List<int> bytes),
{Function onError, void onDone(), bool cancelOnError}) {
return _controller.stream.listen(onData,
onError: onError,
onDone: onDone,
cancelOnError: cancelOnError) as StreamSubscription<List<int>>;
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}

@override
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bazel_worker
version: 0.1.4
version: 0.1.5
description: Tools for creating a bazel persistent worker.
author: Dart Team <[email protected]>
homepage: https://github.com/dart-lang/bazel_worker
Expand Down
8 changes: 4 additions & 4 deletions test/worker_loop_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ void main() {
});
}

void runTests/*<T extends TestWorkerConnection>*/(
void runTests<T extends TestWorkerConnection>(
TestStdin stdinFactory(),
/*=T*/ workerConnectionFactory(Stdin stdin, Stdout stdout),
TestWorkerLoop workerLoopFactory(/*=T*/ connection)) {
T workerConnectionFactory(Stdin stdin, Stdout stdout),
TestWorkerLoop workerLoopFactory(T connection)) {
TestStdin stdinStream;
TestStdoutStream stdoutStream;
var/*=T*/ connection;
T connection;
TestWorkerLoop workerLoop;

setUp(() {
Expand Down

0 comments on commit 1e73c04

Please sign in to comment.