2017-11-20 23:30:42 +01:00
|
|
|
// Copyright 2017 Google Inc. Use of this source code is governed by an
|
|
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
|
2017-12-02 23:39:53 +01:00
|
|
|
@TestOn('vm')
|
|
|
|
|
2018-06-15 22:42:36 +02:00
|
|
|
import 'dart:convert';
|
2017-11-20 23:30:42 +01:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:crypto/crypto.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
test("synchronized files are up-to-date", () {
|
|
|
|
({
|
|
|
|
'lib/src/visitor/async_evaluate.dart': 'lib/src/visitor/evaluate.dart',
|
2018-06-21 02:43:40 +02:00
|
|
|
'lib/src/async_environment.dart': 'lib/src/environment.dart',
|
|
|
|
'lib/src/async_import_cache.dart': 'lib/src/import_cache.dart'
|
2018-06-19 21:46:24 +02:00
|
|
|
})
|
|
|
|
.forEach((sourcePath, targetPath) {
|
2017-11-20 23:30:42 +01:00
|
|
|
var source = new File(sourcePath).readAsStringSync();
|
|
|
|
var target = new File(targetPath).readAsStringSync();
|
|
|
|
|
2018-06-15 22:42:36 +02:00
|
|
|
var hash = sha1.convert(utf8.encode(source));
|
2017-11-20 23:30:42 +01:00
|
|
|
if (!target.contains("Checksum: $hash")) {
|
|
|
|
fail("$targetPath is out-of-date.\n"
|
|
|
|
"Run pub run grinder to update it.");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|