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

Side by Side Diff: pkg/analysis_server/test/resource_test.dart

Issue 308713002: Handle file additions/removals in ContextDirectoryManager. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Konstantin's comments Created 6 years, 6 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 | Annotate | Revision Log
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 library test.resource; 5 library test.resource;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io' as io; 8 import 'dart:io' as io;
9 9
10 import 'mocks.dart'; 10 import 'mocks.dart';
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 test('true', () { 235 test('true', () {
236 provider.newFile('/foo/file.txt', 'qwerty'); 236 provider.newFile('/foo/file.txt', 'qwerty');
237 File file = provider.getResource('/foo/file.txt'); 237 File file = provider.getResource('/foo/file.txt');
238 expect(file, isNotNull); 238 expect(file, isNotNull);
239 expect(file.exists, isTrue); 239 expect(file.exists, isTrue);
240 }); 240 });
241 }); 241 });
242 242
243 test('fullName', () { 243 test('fullName', () {
244 File file = provider.getResource('/foo/bar/file.txt'); 244 File file = provider.getResource('/foo/bar/file.txt');
245 expect(file.fullName, '/foo/bar/file.txt'); 245 expect(file.path, '/foo/bar/file.txt');
246 }); 246 });
247 247
248 test('hashCode', () { 248 test('hashCode', () {
249 File file = provider.getResource('/foo/bar/file.txt'); 249 File file = provider.getResource('/foo/bar/file.txt');
250 file.hashCode; 250 file.hashCode;
251 }); 251 });
252 252
253 test('shortName', () { 253 test('shortName', () {
254 File file = provider.getResource('/foo/bar/file.txt'); 254 File file = provider.getResource('/foo/bar/file.txt');
255 expect(file.shortName, 'file.txt'); 255 expect(file.shortName, 'file.txt');
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 expect(file.exists, isFalse); 546 expect(file.exists, isFalse);
547 }); 547 });
548 548
549 test('true', () { 549 test('true', () {
550 new io.File(path).writeAsStringSync('contents'); 550 new io.File(path).writeAsStringSync('contents');
551 expect(file.exists, isTrue); 551 expect(file.exists, isTrue);
552 }); 552 });
553 }); 553 });
554 554
555 test('fullName', () { 555 test('fullName', () {
556 expect(file.fullName, path); 556 expect(file.path, path);
557 }); 557 });
558 558
559 test('hashCode', () { 559 test('hashCode', () {
560 file.hashCode; 560 file.hashCode;
561 }); 561 });
562 562
563 test('shortName', () { 563 test('shortName', () {
564 expect(file.shortName, 'file.txt'); 564 expect(file.shortName, 'file.txt');
565 }); 565 });
566 566
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 expect(children[1], _isFolder); 623 expect(children[1], _isFolder);
624 expect(children[2], _isFile); 624 expect(children[2], _isFile);
625 }); 625 });
626 }); 626 });
627 }); 627 });
628 } 628 }
629 629
630 var _isFile = new isInstanceOf<File>(); 630 var _isFile = new isInstanceOf<File>();
631 var _isFolder = new isInstanceOf<Folder>(); 631 var _isFolder = new isInstanceOf<Folder>();
632 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>(); 632 var _isMemoryResourceException = new isInstanceOf<MemoryResourceException>();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698