| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 polymer.test.linter_test; | 5 library polymer.test.linter_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:polymer/src/build/common.dart'; | 9 import 'package:polymer/src/build/common.dart'; |
| 10 import 'package:polymer/src/build/linter.dart'; | 10 import 'package:polymer/src/build/linter.dart'; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 'warning: link rel="stylesheet" missing href. (lib/test.html 2 0)', | 280 'warning: link rel="stylesheet" missing href. (lib/test.html 2 0)', |
| 281 'warning: link rel="import" missing href. (lib/test.html 4 0)' | 281 'warning: link rel="import" missing href. (lib/test.html 4 0)' |
| 282 ]); | 282 ]); |
| 283 | 283 |
| 284 _testLinter('<element> is not supported', { | 284 _testLinter('<element> is not supported', { |
| 285 'a|lib/test.html': '''<html> | 285 'a|lib/test.html': '''<html> |
| 286 <element name="x-a"></element> | 286 <element name="x-a"></element> |
| 287 </html>'''.replaceAll(' ', ''), | 287 </html>'''.replaceAll(' ', ''), |
| 288 }, [ | 288 }, [ |
| 289 'warning: <element> elements are not supported, use <polymer-element>' | 289 'warning: <element> elements are not supported, use <polymer-element>' |
| 290 ' instead (lib/test.html 1 0)' | 290 ' instead. (lib/test.html 1 0)' |
| 291 ]); | 291 ]); |
| 292 | 292 |
| 293 _testLinter('do not nest <polymer-element>', { | 293 _testLinter('do not nest <polymer-element>', { |
| 294 'a|lib/test.html': '''<html> | 294 'a|lib/test.html': '''<html> |
| 295 <link rel="import" href="../../packages/polymer/polymer.html"> | 295 <link rel="import" href="../../packages/polymer/polymer.html"> |
| 296 <polymer-element name="x-a"> | 296 <polymer-element name="x-a"> |
| 297 <template><div> | 297 <template><div> |
| 298 <polymer-element name="b"></polymer-element> | 298 <polymer-element name="b"></polymer-element> |
| 299 </div></template> | 299 </div></template> |
| 300 </polymer-element> | 300 </polymer-element> |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 771 } |
| 772 if (outputMessages.isEmpty) { | 772 if (outputMessages.isEmpty) { |
| 773 var linter = new Linter(new TransformOptions()); | 773 var linter = new Linter(new TransformOptions()); |
| 774 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo); | 774 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo); |
| 775 } else { | 775 } else { |
| 776 testLogOutput( | 776 testLogOutput( |
| 777 (options) => new Linter(options), name, inputFiles, outputFiles, | 777 (options) => new Linter(options), name, inputFiles, outputFiles, |
| 778 outputMessages, solo); | 778 outputMessages, solo); |
| 779 } | 779 } |
| 780 } | 780 } |
| OLD | NEW |