Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: pkg/dart_messages/test/dart_messages_test.dart

Issue 2751333002: Run dartfmt on dart_messages (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/dart_messages/lib/shared_messages.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io' as io; 5 import 'dart:io' as io;
6 6
7 import '../lib/shared_messages.dart'; 7 import '../lib/shared_messages.dart';
8 8
9 void testJsonIsUpdated() { 9 void testJsonIsUpdated() {
10 var packageRoot = io.Platform.packageRoot; 10 var packageRoot = io.Platform.packageRoot;
11 if (packageRoot == null || packageRoot == "") { 11 if (packageRoot == null || packageRoot == "") {
12 throw new UnsupportedError("This test requires a package root."); 12 throw new UnsupportedError("This test requires a package root.");
13 } 13 }
14 var jsonUri = Uri.parse(packageRoot).resolve( 14 var jsonUri = Uri
15 'dart_messages/generated/shared_messages.json'); 15 .parse(packageRoot)
16 .resolve('dart_messages/generated/shared_messages.json');
16 var jsonPath = jsonUri.toFilePath(); 17 var jsonPath = jsonUri.toFilePath();
17 var content = new io.File(jsonPath).readAsStringSync(); 18 var content = new io.File(jsonPath).readAsStringSync();
18 if (messagesAsJson != content) { 19 if (messagesAsJson != content) {
19 print("The content of the Dart messages and the corresponding JSON file"); 20 print("The content of the Dart messages and the corresponding JSON file");
20 print("is not the same."); 21 print("is not the same.");
21 print("Please run bin/publish.dart to update the JSON file."); 22 print("Please run bin/publish.dart to update the JSON file.");
22 throw "Content is not the same"; 23 throw "Content is not the same";
23 } 24 }
24 } 25 }
25 26
(...skipping 21 matching lines...) Expand all
47 throw "Specialization doesn't have same id: $id - $genericId"; 48 throw "Specialization doesn't have same id: $id - $genericId";
48 } 49 }
49 } 50 }
50 } 51 }
51 52
52 void main() { 53 void main() {
53 testJsonIsUpdated(); 54 testJsonIsUpdated();
54 testIdsAreUnique(); 55 testIdsAreUnique();
55 testSpecializationsAreOfSameId(); 56 testSpecializationsAreOfSameId();
56 } 57 }
OLDNEW
« no previous file with comments | « pkg/dart_messages/lib/shared_messages.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698