| 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 formatter_test; | 5 library formatter_test; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:path/path.dart'; | 9 import 'package:path/path.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 group('stmt_tests.data', () { | 22 group('stmt_tests.data', () { |
| 23 // NOTE: statement tests are run with transforms enabled | 23 // NOTE: statement tests are run with transforms enabled |
| 24 runTests('stmt_tests.data', (input, expectedOutput) { | 24 runTests('stmt_tests.data', (input, expectedOutput) { |
| 25 expect(formatStatement(input, | 25 expect(formatStatement(input, |
| 26 options: new FormatterOptions(codeTransforms: true)) + '\n', | 26 options: new FormatterOptions(codeTransforms: true)) + '\n', |
| 27 equals(expectedOutput)); | 27 equals(expectedOutput)); |
| 28 }); | 28 }); |
| 29 }); | 29 }); |
| 30 | 30 |
| 31 /// Data-driven compilation unit tests | 31 /// Data-driven compilation unit tests |
| 32 group('cu_tests.data', () { | 32 /// TODO(scheglov) https://code.google.com/p/dart/issues/detail?id=18315 |
| 33 runTests('cu_tests.data', (input, expectedOutput) { | 33 // group('cu_tests.data', () { |
| 34 expectCUFormatsTo(input, expectedOutput); | 34 // runTests('cu_tests.data', (input, expectedOutput) { |
| 35 }); | 35 // expectCUFormatsTo(input, expectedOutput); |
| 36 }); | 36 // }); |
| 37 // }); |
| 37 | 38 |
| 38 /// Data-driven Style Guide acceptance tests | 39 /// Data-driven Style Guide acceptance tests |
| 39 group('style_guide_tests.data', () { | 40 group('style_guide_tests.data', () { |
| 40 runTests('style_guide_tests.data', (input, expectedOutput) { | 41 runTests('style_guide_tests.data', (input, expectedOutput) { |
| 41 expectCUFormatsTo(input, expectedOutput); | 42 expectCUFormatsTo(input, expectedOutput); |
| 42 }); | 43 }); |
| 43 }); | 44 }); |
| 44 | 45 |
| 45 /// Formatter tests | 46 /// Formatter tests |
| 46 group('formatter', () { | 47 group('formatter', () { |
| (...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 input += lines[i++] + '\n'; | 1486 input += lines[i++] + '\n'; |
| 1486 } | 1487 } |
| 1487 while(++i < lines.length && !lines[i].startsWith('>>>')) { | 1488 while(++i < lines.length && !lines[i].startsWith('>>>')) { |
| 1488 expectedOutput += lines[i] + '\n'; | 1489 expectedOutput += lines[i] + '\n'; |
| 1489 } | 1490 } |
| 1490 test('test - (${testIndex++})', () { | 1491 test('test - (${testIndex++})', () { |
| 1491 expectClause(input, expectedOutput); | 1492 expectClause(input, expectedOutput); |
| 1492 }); | 1493 }); |
| 1493 } | 1494 } |
| 1494 } | 1495 } |
| OLD | NEW |