13
dev/bots/test/bot_test.dart
Normal file
13
dev/bots/test/bot_test.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright 2017 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 'common.dart';
|
||||
|
||||
void main() {
|
||||
test('BOT variable is set on bots', () {
|
||||
expect(Platform.environment['BOT'], 'true');
|
||||
});
|
||||
}
|
||||
21
dev/bots/test/sdk_directory_has_space_test.dart
Normal file
21
dev/bots/test/sdk_directory_has_space_test.dart
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2017 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:path/path.dart' as path;
|
||||
|
||||
import 'common.dart';
|
||||
|
||||
void main() {
|
||||
test('We are in a directory with a space in it', () async {
|
||||
// The Flutter SDK should be in a directory with a space in it, to make sure
|
||||
// our tools support that.
|
||||
final String expectedName = Platform.environment['FLUTTER_SDK_PATH_WITH_SPACE'];
|
||||
expect(expectedName, 'flutter sdk');
|
||||
expect(expectedName, contains(' '));
|
||||
final List<String> parts = path.split(Directory.current.absolute.path);
|
||||
expect(parts.reversed.take(3), <String>['bots', 'dev', expectedName]);
|
||||
});
|
||||
}
|
||||
@@ -29,7 +29,11 @@ void main() {
|
||||
];
|
||||
for (String version in valid_versions) {
|
||||
when(file.readAsString()).thenAnswer((Invocation invocation) => Future<String>.value(version));
|
||||
expect(await verifyVersion(version, file), isTrue, reason: '$version is invalid');
|
||||
expect(
|
||||
await verifyVersion(file),
|
||||
isNull,
|
||||
reason: '$version is valid but verifyVersionFile said it was bad',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -41,10 +45,15 @@ void main() {
|
||||
'1.2.3-pre',
|
||||
'1.2.3-pre.1+hotfix.1',
|
||||
' 1.2.3',
|
||||
'1.2.3-hotfix.1',
|
||||
];
|
||||
for (String version in invalid_versions) {
|
||||
when(file.readAsString()).thenAnswer((Invocation invocation) => Future<String>.value(version));
|
||||
expect(await verifyVersion(version, file), isFalse);
|
||||
expect(
|
||||
await verifyVersion(file),
|
||||
'The version logic generated an invalid version string: "$version".',
|
||||
reason: '$version is invalid but verifyVersionFile said it was fine',
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user