-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compile asynchronous code to synchronous
See #9
- Loading branch information
Showing
6 changed files
with
291 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// 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. | ||
|
||
import 'dart:convert'; | ||
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', | ||
'lib/src/async_environment.dart': 'lib/src/environment.dart' | ||
}).forEach((sourcePath, targetPath) { | ||
var source = new File(sourcePath).readAsStringSync(); | ||
var target = new File(targetPath).readAsStringSync(); | ||
|
||
var hash = sha1.convert(UTF8.encode(source)); | ||
if (!target.contains("Checksum: $hash")) { | ||
fail("$targetPath is out-of-date.\n" | ||
"Run pub run grinder to update it."); | ||
} | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.