flutter analyze --watch (#6093)
This commit is contained in:
@@ -6,7 +6,7 @@ import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/base/os.dart';
|
||||
import 'package:flutter_tools/src/commands/watch.dart';
|
||||
import 'package:flutter_tools/src/commands/analyze_continuously.dart';
|
||||
import 'package:flutter_tools/src/dart/pub.dart';
|
||||
import 'package:flutter_tools/src/dart/sdk.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
|
||||
@@ -29,7 +29,7 @@ void main() {
|
||||
return server?.dispose();
|
||||
});
|
||||
|
||||
group('watch', () {
|
||||
group('analyze --watch', () {
|
||||
testUsingContext('AnalysisServer success', () async {
|
||||
_createSampleProject(tempDir);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/commands/analyze.dart';
|
||||
import 'package:flutter_tools/src/commands/analyze_base.dart';
|
||||
import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
@@ -27,27 +27,26 @@ void main() {
|
||||
group('analyze', () {
|
||||
|
||||
testUsingContext('inRepo', () {
|
||||
AnalyzeCommand cmd = new AnalyzeCommand();
|
||||
// Absolute paths
|
||||
expect(cmd.inRepo(<String>[tempDir.path]), isFalse);
|
||||
expect(cmd.inRepo(<String>[path.join(tempDir.path, 'foo')]), isFalse);
|
||||
expect(cmd.inRepo(<String>[Cache.flutterRoot]), isTrue);
|
||||
expect(cmd.inRepo(<String>[path.join(Cache.flutterRoot, 'foo')]), isTrue);
|
||||
expect(inRepo(<String>[tempDir.path]), isFalse);
|
||||
expect(inRepo(<String>[path.join(tempDir.path, 'foo')]), isFalse);
|
||||
expect(inRepo(<String>[Cache.flutterRoot]), isTrue);
|
||||
expect(inRepo(<String>[path.join(Cache.flutterRoot, 'foo')]), isTrue);
|
||||
// Relative paths
|
||||
String oldWorkingDirectory = path.current;
|
||||
try {
|
||||
Directory.current = Cache.flutterRoot;
|
||||
expect(cmd.inRepo(<String>['.']), isTrue);
|
||||
expect(cmd.inRepo(<String>['foo']), isTrue);
|
||||
expect(inRepo(<String>['.']), isTrue);
|
||||
expect(inRepo(<String>['foo']), isTrue);
|
||||
Directory.current = tempDir.path;
|
||||
expect(cmd.inRepo(<String>['.']), isFalse);
|
||||
expect(cmd.inRepo(<String>['foo']), isFalse);
|
||||
expect(inRepo(<String>['.']), isFalse);
|
||||
expect(inRepo(<String>['foo']), isFalse);
|
||||
} finally {
|
||||
Directory.current = oldWorkingDirectory;
|
||||
}
|
||||
// Ensure no exceptions
|
||||
cmd.inRepo(null);
|
||||
cmd.inRepo(<String>[]);
|
||||
inRepo(null);
|
||||
inRepo(<String>[]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user