Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit c81b630

Browse files
authored
Remove scheduled test (#44)
1 parent 2b7bb86 commit c81b630

21 files changed

+275
-443
lines changed

.travis.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
language: dart
2-
dart:
3-
- dev
4-
- stable
2+
dart: dev
53

64
dart_task:
7-
- test
8-
9-
matrix:
10-
include:
11-
- dart: dev
12-
dart_task: dartfmt
13-
# Only care about being analyzer clean for dev and stable
14-
- dart: dev
15-
dart_task: dartanalyzer
16-
- dart: stable
17-
dart_task: dartanalyzer
5+
- test
6+
- dartfmt
7+
- dartanalyzer
188

199
# Only building master means that we don't run two builds for each pull request.
2010
branches:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.9.7+6
2+
3+
* Internal changes only, namely removing dep on scheduled test.
4+
15
# 0.9.7+5
26

37
* Fix an analysis warning.

lib/src/utils.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,6 @@ Stream<T> futureStream<T>(Future<Stream<T>> future, {bool broadcast: false}) {
7171
/// under the covers.
7272
Future newFuture(callback()) => new Future.value().then((_) => callback());
7373

74-
/// Returns a [Future] that completes after pumping the event queue [times]
75-
/// times. By default, this should pump the event queue enough times to allow
76-
/// any code to run, as long as it's not waiting on some external event.
77-
Future pumpEventQueue([int times = 20]) {
78-
if (times == 0) return new Future.value();
79-
// We use a delayed future to allow microtask events to finish. The
80-
// Future.value or Future() constructors use scheduleMicrotask themselves and
81-
// would therefore not wait for microtask callbacks that are scheduled after
82-
// invoking this method.
83-
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
84-
}
85-
8674
/// A stream transformer that batches all events that are sent at the same time.
8775
///
8876
/// When multiple events are synchronously added to a stream controller, the

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: watcher
2-
version: 0.9.7+6.dev
2+
version: 0.9.7+6
33
author: Dart Team <[email protected]>
44
homepage: https://github.com/dart-lang/watcher
55
description: >
@@ -12,5 +12,5 @@ dependencies:
1212
path: '>=0.9.0 <2.0.0'
1313
dev_dependencies:
1414
benchmark_harness: '^1.0.4'
15-
scheduled_test: '^0.12.0'
16-
test: '^0.12.18+1'
15+
test: '^0.12.29'
16+
test_descriptor: '^1.0.0'

test/directory_watcher/linux_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@TestOn('linux')
66

7-
import 'package:scheduled_test/scheduled_test.dart';
7+
import 'package:test/test.dart';
88
import 'package:watcher/src/directory_watcher/linux.dart';
99
import 'package:watcher/watcher.dart';
1010

@@ -14,8 +14,6 @@ import '../utils.dart';
1414
void main() {
1515
watcherFactory = (dir) => new LinuxDirectoryWatcher(dir);
1616

17-
setUp(createSandbox);
18-
1917
sharedTests();
2018

2119
test('DirectoryWatcher creates a LinuxDirectoryWatcher on Linux', () {
@@ -24,15 +22,15 @@ void main() {
2422
});
2523

2624
test('emits events for many nested files moved out then immediately back in',
27-
() {
25+
() async {
2826
withPermutations(
2927
(i, j, k) => writeFile("dir/sub/sub-$i/sub-$j/file-$k.txt"));
30-
startWatcher(path: "dir");
28+
await startWatcher(path: "dir");
3129

3230
renameDir("dir/sub", "sub");
3331
renameDir("sub", "dir/sub");
3432

35-
allowEither(() {
33+
await allowEither(() {
3634
inAnyOrder(withPermutations(
3735
(i, j, k) => isRemoveEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")));
3836

test/directory_watcher/mac_os_test.dart

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@TestOn('mac-os')
66

7-
import 'package:scheduled_test/scheduled_test.dart';
7+
import 'package:test/test.dart';
88
import 'package:watcher/src/directory_watcher/mac_os.dart';
99
import 'package:watcher/watcher.dart';
1010

@@ -14,8 +14,6 @@ import '../utils.dart';
1414
void main() {
1515
watcherFactory = (dir) => new MacOSDirectoryWatcher(dir);
1616

17-
setUp(createSandbox);
18-
1917
sharedTests();
2018

2119
test('DirectoryWatcher creates a MacOSDirectoryWatcher on Mac OS', () {
@@ -25,28 +23,28 @@ void main() {
2523

2624
test(
2725
'does not notify about the watched directory being deleted and '
28-
'recreated immediately before watching', () {
26+
'recreated immediately before watching', () async {
2927
createDir("dir");
3028
writeFile("dir/old.txt");
3129
deleteDir("dir");
3230
createDir("dir");
3331

34-
startWatcher(path: "dir");
32+
await startWatcher(path: "dir");
3533
writeFile("dir/newer.txt");
36-
expectAddEvent("dir/newer.txt");
34+
await expectAddEvent("dir/newer.txt");
3735
});
3836

3937
test('emits events for many nested files moved out then immediately back in',
40-
() {
38+
() async {
4139
withPermutations(
4240
(i, j, k) => writeFile("dir/sub/sub-$i/sub-$j/file-$k.txt"));
4341

44-
startWatcher(path: "dir");
42+
await startWatcher(path: "dir");
4543

4644
renameDir("dir/sub", "sub");
4745
renameDir("sub", "dir/sub");
4846

49-
allowEither(() {
47+
await allowEither(() {
5048
inAnyOrder(withPermutations(
5149
(i, j, k) => isRemoveEvent("dir/sub/sub-$i/sub-$j/file-$k.txt")));
5250

test/directory_watcher/polling_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:scheduled_test/scheduled_test.dart';
5+
import 'package:test/test.dart';
66
import 'package:watcher/watcher.dart';
77

88
import 'shared.dart';
@@ -13,16 +13,14 @@ void main() {
1313
watcherFactory = (dir) => new PollingDirectoryWatcher(dir,
1414
pollingDelay: new Duration(milliseconds: 100));
1515

16-
setUp(createSandbox);
17-
1816
sharedTests();
1917

20-
test('does not notify if the modification time did not change', () {
18+
test('does not notify if the modification time did not change', () async {
2119
writeFile("a.txt", contents: "before");
2220
writeFile("b.txt", contents: "before");
23-
startWatcher();
21+
await startWatcher();
2422
writeFile("a.txt", contents: "after", updateModified: false);
2523
writeFile("b.txt", contents: "after");
26-
expectModifyEvent("b.txt");
24+
await expectModifyEvent("b.txt");
2725
});
2826
}

0 commit comments

Comments
 (0)