Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 8b6ba73

Browse files
authored
Fix runtime Dart 2 errors in tests (#3)
Works around dart-lang/sdk#33015.
1 parent 20851d9 commit 8b6ba73

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/default_test.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,17 @@ void main() {
6969
withClock(new Clock.fixed(outerTime), () {
7070
expect(clock.now(), equals(outerTime));
7171

72-
expect(
73-
() => withClock(fixed(2016, 11, 8), neverCalled), throwsStateError);
72+
expect(() => withClock(fixed(2016, 11, 8), neverCalledVoid),
73+
throwsStateError);
7474

7575
expect(clock.now(), equals(outerTime));
7676
}, isFinal: true);
7777
});
7878
});
7979
}
80+
81+
/// A wrapper for [neverCalled] that works around sdk#33015.
82+
void Function() get neverCalledVoid {
83+
var function = neverCalled;
84+
return () => neverCalled();
85+
}

0 commit comments

Comments
 (0)