Skip to content

Commit

Permalink
Remove scheduled test (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
grouma authored Jan 5, 2018
1 parent 2b7bb86 commit c81b630
Show file tree
Hide file tree
Showing 21 changed files with 275 additions and 443 deletions.
18 changes: 4 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
language: dart
dart:
- dev
- stable
dart: dev

dart_task:
- test

matrix:
include:
- dart: dev
dart_task: dartfmt
# Only care about being analyzer clean for dev and stable
- dart: dev
dart_task: dartanalyzer
- dart: stable
dart_task: dartanalyzer
- test
- dartfmt
- dartanalyzer

# Only building master means that we don't run two builds for each pull request.
branches:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.9.7+6

* Internal changes only, namely removing dep on scheduled test.

# 0.9.7+5

* Fix an analysis warning.
Expand Down
12 changes: 0 additions & 12 deletions lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ Stream<T> futureStream<T>(Future<Stream<T>> future, {bool broadcast: false}) {
/// under the covers.
Future newFuture(callback()) => new Future.value().then((_) => callback());

/// Returns a [Future] that completes after pumping the event queue [times]
/// times. By default, this should pump the event queue enough times to allow
/// any code to run, as long as it's not waiting on some external event.
Future pumpEventQueue([int times = 20]) {
if (times == 0) return new Future.value();
// We use a delayed future to allow microtask events to finish. The
// Future.value or Future() constructors use scheduleMicrotask themselves and
// would therefore not wait for microtask callbacks that are scheduled after
// invoking this method.
return new Future.delayed(Duration.ZERO, () => pumpEventQueue(times - 1));
}

/// A stream transformer that batches all events that are sent at the same time.
///
/// When multiple events are synchronously added to a stream controller, the
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: watcher
version: 0.9.7+6.dev
version: 0.9.7+6
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/watcher
description: >
Expand All @@ -12,5 +12,5 @@ dependencies:
path: '>=0.9.0 <2.0.0'
dev_dependencies:
benchmark_harness: '^1.0.4'
scheduled_test: '^0.12.0'
test: '^0.12.18+1'
test: '^0.12.29'
test_descriptor: '^1.0.0'
10 changes: 4 additions & 6 deletions test/directory_watcher/linux_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@TestOn('linux')

import 'package:scheduled_test/scheduled_test.dart';
import 'package:test/test.dart';
import 'package:watcher/src/directory_watcher/linux.dart';
import 'package:watcher/watcher.dart';

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

setUp(createSandbox);

sharedTests();

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

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

renameDir("dir/sub", "sub");
renameDir("sub", "dir/sub");

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

Expand Down
16 changes: 7 additions & 9 deletions test/directory_watcher/mac_os_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@TestOn('mac-os')

import 'package:scheduled_test/scheduled_test.dart';
import 'package:test/test.dart';
import 'package:watcher/src/directory_watcher/mac_os.dart';
import 'package:watcher/watcher.dart';

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

setUp(createSandbox);

sharedTests();

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

test(
'does not notify about the watched directory being deleted and '
'recreated immediately before watching', () {
'recreated immediately before watching', () async {
createDir("dir");
writeFile("dir/old.txt");
deleteDir("dir");
createDir("dir");

startWatcher(path: "dir");
await startWatcher(path: "dir");
writeFile("dir/newer.txt");
expectAddEvent("dir/newer.txt");
await expectAddEvent("dir/newer.txt");
});

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

startWatcher(path: "dir");
await startWatcher(path: "dir");

renameDir("dir/sub", "sub");
renameDir("sub", "dir/sub");

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

Expand Down
10 changes: 4 additions & 6 deletions test/directory_watcher/polling_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:scheduled_test/scheduled_test.dart';
import 'package:test/test.dart';
import 'package:watcher/watcher.dart';

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

setUp(createSandbox);

sharedTests();

test('does not notify if the modification time did not change', () {
test('does not notify if the modification time did not change', () async {
writeFile("a.txt", contents: "before");
writeFile("b.txt", contents: "before");
startWatcher();
await startWatcher();
writeFile("a.txt", contents: "after", updateModified: false);
writeFile("b.txt", contents: "after");
expectModifyEvent("b.txt");
await expectModifyEvent("b.txt");
});
}
Loading

0 comments on commit c81b630

Please sign in to comment.