Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Side by Side Diff: pkg/analyzer/test/generated/java_io_test.dart

Issue 1282823004: Possible fix for tests failing on the Windows bots (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // This code was auto-generated, is not intended to be edited, and is subject to 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. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.java_io_test; 8 library engine.java_io_test;
9 9
10 import 'dart:io'; 10 import 'dart:io';
11 11
12 import 'package:analyzer/src/generated/java_io.dart'; 12 import 'package:analyzer/src/generated/java_io.dart';
13 import 'package:unittest/unittest.dart'; 13 import 'package:unittest/unittest.dart';
14 14
15 import '../utils.dart'; 15 import '../utils.dart';
16 16
17 main() { 17 main() {
18 initializeTestEnvironment(); 18 initializeTestEnvironment();
19 group('JavaFile', () { 19 group('JavaFile', () {
20 group('toURI', () { 20 group('toURI', () {
21 test('forAbsolute', () { 21 test('forAbsolute', () {
22 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); 22 String tempPath = '/temp';
23 try { 23 String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
24 String tempPath = JavaFile.pathContext 24 // we use an absolute path
25 .normalize(JavaFile.pathContext.absolute(tempDir.path)); 25 expect(JavaFile.pathContext.isAbsolute(path), isTrue,
26 String path = JavaFile.pathContext.join(tempPath, 'foo.dart'); 26 reason: '"$path" is not absolute');
27 // we use an absolute path 27 // test that toURI() returns an absolute URI
28 expect(JavaFile.pathContext.isAbsolute(path), isTrue, 28 Uri uri = new JavaFile(path).toURI();
29 reason: '"$path" is not absolute'); 29 expect(uri.isAbsolute, isTrue);
30 // test that toURI() returns an absolute URI 30 expect(uri.scheme, 'file');
31 Uri uri = new JavaFile(path).toURI();
32 expect(uri.isAbsolute, isTrue);
33 expect(uri.scheme, 'file');
34 } finally {
35 tempDir.deleteSync(recursive: true);
36 }
37 }); 31 });
38 test('forRelative', () { 32 test('forRelative', () {
39 var tempDir = Directory.systemTemp.createTempSync('java_io_test'); 33 String tempPath = '/temp';
40 try { 34 String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
41 String tempPath = JavaFile.pathContext 35 expect(JavaFile.pathContext.isAbsolute(path), isTrue,
42 .normalize(JavaFile.pathContext.absolute(tempDir.path)); 36 reason: '"$path" is not absolute');
43 String path = JavaFile.pathContext.join(tempPath, 'foo.dart'); 37 // prepare a relative path
44 expect(JavaFile.pathContext.isAbsolute(path), isTrue, 38 // We should not check that "relPath" is actually relative -
45 reason: '"$path" is not absolute'); 39 // it may be not on Windows, if "temp" is on other disk.
46 // prepare a relative path 40 String relPath = JavaFile.pathContext.relative(path);
47 // We should not check that "relPath" is actually relative - 41 // test that toURI() returns an absolute URI
48 // it may be not on Windows, if "temp" is on other disk. 42 Uri uri = new JavaFile(relPath).toURI();
49 String relPath = JavaFile.pathContext.relative(path); 43 expect(uri.isAbsolute, isTrue);
50 // test that toURI() returns an absolute URI 44 expect(uri.scheme, 'file');
51 Uri uri = new JavaFile(relPath).toURI();
52 expect(uri.isAbsolute, isTrue);
53 expect(uri.scheme, 'file');
54 } finally {
55 tempDir.deleteSync(recursive: true);
56 }
57 }); 45 });
58 }); 46 });
59 }); 47 });
60 } 48 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698