| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. |
| 7 |
| 8 library engine.java_io_test; |
| 9 |
| 10 import 'package:analyzer/src/generated/java_io.dart'; |
| 11 import 'package:unittest/unittest.dart'; |
| 12 import 'package:path/path.dart'; |
| 13 import 'dart:io'; |
| 14 |
| 15 main() { |
| 16 group('JavaFile', () { |
| 17 group('toURI', () { |
| 18 test('forAbsolute', () { |
| 19 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); |
| 20 try { |
| 21 String tempPath = normalize(absolute(tempDir.path)); |
| 22 String path = join(tempPath, 'foo.dart'); |
| 23 // we use an absolute path |
| 24 expect(isAbsolute(path), isTrue); |
| 25 // test that toURI() returns an absolute URI |
| 26 Uri uri = new JavaFile(path).toURI(); |
| 27 expect(uri.isAbsolute, isTrue); |
| 28 expect(uri.scheme, 'file'); |
| 29 } finally { |
| 30 tempDir.deleteSync(recursive: true); |
| 31 } |
| 32 }); |
| 33 test('forRelative', () { |
| 34 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); |
| 35 try { |
| 36 String tempPath = normalize(absolute(tempDir.path)); |
| 37 String path = join(tempPath, 'foo.dart'); |
| 38 expect(isAbsolute(path), isTrue); |
| 39 // prepare a relative path |
| 40 String relPath = relative(path); |
| 41 expect(isAbsolute(relPath), isFalse); |
| 42 // test that toURI() returns an absolute URI |
| 43 Uri uri = new JavaFile(relPath).toURI(); |
| 44 expect(uri.isAbsolute, isTrue); |
| 45 expect(uri.scheme, 'file'); |
| 46 } finally { |
| 47 tempDir.deleteSync(recursive: true); |
| 48 } |
| 49 }); |
| 50 }); |
| 51 }); |
| 52 } |
| OLD | NEW |