Skip to content

Commit

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

I also fixed a few places to use the real generic method syntax while
I was at it.

I bumped the version to 0.2.0-dev since my change is technically
breaking -- it changes the return type of TestStdinAsync.controller.
If you don't feel that will actually break any real users, I can do
0.1.5-dev instead.

This needs to roll into Google after I land it. If you'd like me to
publish this, let me know and I'll do 0.1.5 instead.
  • Loading branch information
munificent committed Nov 3, 2017
1 parent d28530d commit d598504
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.2.0

* 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.2.0-dev
description: Tools for creating a bazel persistent worker.
author: Dart Team <misc@dartlang.org>
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 d598504

Please sign in to comment.