| 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 analyzer.test.generated.java_io_test; | 5 library analyzer.test.generated.java_io_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/java_io.dart'; | 7 import 'package:analyzer/src/generated/java_io.dart'; |
| 8 import 'package:path/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
| 9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 | 10 |
| 11 import '../utils.dart'; | |
| 12 | |
| 13 main() { | 11 main() { |
| 14 initializeTestEnvironment(); | |
| 15 group('JavaFile', () { | 12 group('JavaFile', () { |
| 16 group('toURI', () { | 13 group('toURI', () { |
| 17 test('forAbsolute', () { | 14 test('forAbsolute', () { |
| 18 String tempPath = '/temp'; | 15 String tempPath = '/temp'; |
| 19 String absolutePath = path.context.join(tempPath, 'foo.dart'); | 16 String absolutePath = path.context.join(tempPath, 'foo.dart'); |
| 20 // we use an absolute path | 17 // we use an absolute path |
| 21 expect(path.context.isAbsolute(absolutePath), isTrue, | 18 expect(path.context.isAbsolute(absolutePath), isTrue, |
| 22 reason: '"$absolutePath" is not absolute'); | 19 reason: '"$absolutePath" is not absolute'); |
| 23 // test that toURI() returns an absolute URI | 20 // test that toURI() returns an absolute URI |
| 24 Uri uri = new JavaFile(absolutePath).toURI(); | 21 Uri uri = new JavaFile(absolutePath).toURI(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 // it may be not on Windows, if "temp" is on other disk. | 32 // it may be not on Windows, if "temp" is on other disk. |
| 36 String relPath = path.context.relative(absolutePath); | 33 String relPath = path.context.relative(absolutePath); |
| 37 // test that toURI() returns an absolute URI | 34 // test that toURI() returns an absolute URI |
| 38 Uri uri = new JavaFile(relPath).toURI(); | 35 Uri uri = new JavaFile(relPath).toURI(); |
| 39 expect(uri.isAbsolute, isTrue); | 36 expect(uri.isAbsolute, isTrue); |
| 40 expect(uri.scheme, 'file'); | 37 expect(uri.scheme, 'file'); |
| 41 }); | 38 }); |
| 42 }); | 39 }); |
| 43 }); | 40 }); |
| 44 } | 41 } |
| OLD | NEW |