| 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.test.io; | 5 library dart_style.test.io; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'package:dart_style/src/io.dart'; | 10 import 'package:dart_style/src/io.dart'; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Create a link to the target file in the code directory. | 149 // Create a link to the target file in the code directory. |
| 150 new Link(p.join(d.defaultRoot, 'code', 'linked_file.dart')) | 150 new Link(p.join(d.defaultRoot, 'code', 'linked_file.dart')) |
| 151 .createSync(p.join(d.defaultRoot, 'target_file.dart')); | 151 .createSync(p.join(d.defaultRoot, 'target_file.dart')); |
| 152 }, 'Create symlinks.'); | 152 }, 'Create symlinks.'); |
| 153 | 153 |
| 154 schedule(() { | 154 schedule(() { |
| 155 var dir = new Directory(p.join(d.defaultRoot, 'code')); | 155 var dir = new Directory(p.join(d.defaultRoot, 'code')); |
| 156 processDirectory(overwriteOptions, dir); | 156 processDirectory(overwriteOptions, dir); |
| 157 }, 'Run formatter.'); | 157 }, 'Run formatter.'); |
| 158 | 158 |
| 159 d.dir('code', [d.file('linked_file.dart', unformattedSource),]) | 159 d.dir( |
| 160 .validate(); | 160 'code', [d.file('linked_file.dart', unformattedSource),]).validate(); |
| 161 }); | 161 }); |
| 162 | 162 |
| 163 test("follows file symlinks when 'followLinks' is true", () { | 163 test("follows file symlinks when 'followLinks' is true", () { |
| 164 d.dir('code').create(); | 164 d.dir('code').create(); |
| 165 d.file('target_file.dart', unformattedSource).create(); | 165 d.file('target_file.dart', unformattedSource).create(); |
| 166 | 166 |
| 167 schedule(() { | 167 schedule(() { |
| 168 // Create a link to the target file in the code directory. | 168 // Create a link to the target file in the code directory. |
| 169 new Link(p.join(d.defaultRoot, 'code', 'linked_file.dart')) | 169 new Link(p.join(d.defaultRoot, 'code', 'linked_file.dart')) |
| 170 .createSync(p.join(d.defaultRoot, 'target_file.dart')); | 170 .createSync(p.join(d.defaultRoot, 'target_file.dart')); |
| 171 }); | 171 }); |
| 172 | 172 |
| 173 schedule(() { | 173 schedule(() { |
| 174 var dir = new Directory(p.join(d.defaultRoot, 'code')); | 174 var dir = new Directory(p.join(d.defaultRoot, 'code')); |
| 175 processDirectory(followOptions, dir); | 175 processDirectory(followOptions, dir); |
| 176 }, 'running formatter'); | 176 }, 'running formatter'); |
| 177 | 177 |
| 178 d.dir('code', [d.file('linked_file.dart', formattedSource),]).validate(); | 178 d.dir('code', [d.file('linked_file.dart', formattedSource),]).validate(); |
| 179 }); | 179 }); |
| 180 } | 180 } |
| 181 } | 181 } |
| OLD | NEW |