OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart_style.benchmark.benchmark; | 5 library dart_style.benchmark.benchmark; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:dart_style/dart_style.dart'; | 9 import 'package:dart_style/dart_style.dart'; |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 return result; | 54 return result; |
55 } | 55 } |
56 | 56 |
57 void formatSource() { | 57 void formatSource() { |
58 var formatter = new DartFormatter(); | 58 var formatter = new DartFormatter(); |
59 var result = formatter.format(source); | 59 var result = formatter.format(source); |
60 | 60 |
61 // Sanity check to make sure the output is what we expect and to make sure | 61 // Sanity check to make sure the output is what we expect and to make sure |
62 // the VM doesn't optimize "dead" code away. | 62 // the VM doesn't optimize "dead" code away. |
63 if (result.length != 29796) { | 63 if (result.length != 29791) { |
64 print("Incorrect output (length ${result.length}):\n$result"); | 64 print("Incorrect output (length ${result.length}):\n$result"); |
65 exit(1); | 65 exit(1); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 const source = r""" | 69 const source = r""" |
70 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 70 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
71 // for details. All rights reserved. Use of this source code is governed by a | 71 // for details. All rights reserved. Use of this source code is governed by a |
72 // BSD-style license that can be found in the LICENSE file. | 72 // BSD-style license that can be found in the LICENSE file. |
73 | 73 |
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 /// Throws a [SolveFailure] if not. | 876 /// Throws a [SolveFailure] if not. |
877 void _validateSdkConstraint(Pubspec pubspec) { | 877 void _validateSdkConstraint(Pubspec pubspec) { |
878 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; | 878 if (pubspec.environment.sdkVersion.allows(sdk.version)) return; |
879 | 879 |
880 throw new BadSdkVersionException( | 880 throw new BadSdkVersionException( |
881 pubspec.name, | 881 pubspec.name, |
882 'Package ${pubspec.name} requires SDK version ' | 882 'Package ${pubspec.name} requires SDK version ' |
883 '${pubspec.environment.sdkVersion} but the current SDK is ' '${sdk.ver
sion}.'); | 883 '${pubspec.environment.sdkVersion} but the current SDK is ' '${sdk.ver
sion}.'); |
884 } | 884 } |
885 """; | 885 """; |
OLD | NEW |