Hello services run (#4969)
* making flutter run work with gradle * locate android studio * add test for settings * review comments
This commit is contained in:
@@ -16,6 +16,7 @@ import 'analyze_test.dart' as analyze_test;
|
||||
import 'android_device_test.dart' as android_device_test;
|
||||
import 'android_sdk_test.dart' as android_sdk_test;
|
||||
import 'base_utils_test.dart' as base_utils_test;
|
||||
import 'config_test.dart' as config_test;
|
||||
import 'context_test.dart' as context_test;
|
||||
import 'create_test.dart' as create_test;
|
||||
import 'daemon_test.dart' as daemon_test;
|
||||
@@ -33,6 +34,7 @@ import 'test_test.dart' as test_test;
|
||||
import 'toolchain_test.dart' as toolchain_test;
|
||||
import 'trace_test.dart' as trace_test;
|
||||
import 'upgrade_test.dart' as upgrade_test;
|
||||
import 'utils_test.dart' as utils_test;
|
||||
|
||||
void main() {
|
||||
Cache.disableLocking();
|
||||
@@ -43,6 +45,7 @@ void main() {
|
||||
android_device_test.main();
|
||||
android_sdk_test.main();
|
||||
base_utils_test.main();
|
||||
config_test.main();
|
||||
context_test.main();
|
||||
create_test.main();
|
||||
daemon_test.main();
|
||||
@@ -60,4 +63,5 @@ void main() {
|
||||
toolchain_test.main();
|
||||
trace_test.main();
|
||||
upgrade_test.main();
|
||||
utils_test.main();
|
||||
}
|
||||
|
||||
38
packages/flutter_tools/test/config_test.dart
Normal file
38
packages/flutter_tools/test/config_test.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_tools/src/base/config.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
Config config;
|
||||
|
||||
setUp(() {
|
||||
Directory tempDiretory = Directory.systemTemp.createTempSync('flutter_test');
|
||||
File file = new File(path.join(tempDiretory.path, '.settings'));
|
||||
config = new Config(file);
|
||||
});
|
||||
|
||||
group('config', () {
|
||||
test('get set value', () async {
|
||||
expect(config.getValue('foo'), null);
|
||||
config.setValue('foo', 'bar');
|
||||
expect(config.getValue('foo'), 'bar');
|
||||
expect(config.keys, contains('foo'));
|
||||
});
|
||||
|
||||
test('removeValue', () async {
|
||||
expect(config.getValue('foo'), null);
|
||||
config.setValue('foo', 'bar');
|
||||
expect(config.getValue('foo'), 'bar');
|
||||
expect(config.keys, contains('foo'));
|
||||
config.removeValue('foo');
|
||||
expect(config.getValue('foo'), null);
|
||||
expect(config.keys, isNot(contains('foo')));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
// Copyright 2016 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
21
packages/flutter_tools/test/utils_test.dart
Normal file
21
packages/flutter_tools/test/utils_test.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2016 The Chromium Authors. 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:flutter_tools/src/base/utils.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group('SettingsFile', () {
|
||||
test('parse', () {
|
||||
SettingsFile file = new SettingsFile.parse('''
|
||||
# ignore comment
|
||||
foo=bar
|
||||
baz=qux
|
||||
''');
|
||||
expect(file.values['foo'], 'bar');
|
||||
expect(file.values['baz'], 'qux');
|
||||
expect(file.values, hasLength(2));
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user