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

Side by Side Diff: pkg/analyzer/test/file_system/memory_file_system_test.dart

Issue 2397813002: Fix context comparisons (Closed)
Patch Set: fixed more cases Created 4 years, 2 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 | « pkg/analyzer/lib/src/dart/sdk/sdk.dart ('k') | 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 library analyzer.test.file_system.memory_file_system_test; 5 library analyzer.test.file_system.memory_file_system_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:core'; 8 import 'dart:core';
9 9
10 import 'package:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 source = file.createSource(); 458 source = file.createSource();
459 } 459 }
460 460
461 void test_contents() { 461 void test_contents() {
462 TimestampedData<String> contents = source.contents; 462 TimestampedData<String> contents = source.contents;
463 expect(contents.data, 'library test;'); 463 expect(contents.data, 'library test;');
464 } 464 }
465 465
466 void test_encoding() { 466 void test_encoding() {
467 String expected = 'file:///foo/test.dart'; 467 String expected = 'file:///foo/test.dart';
468 if (provider.pathContext == windows) { 468 if (provider.pathContext.style == windows.style) {
469 expected = 'file:///C:/foo/test.dart'; 469 expected = 'file:///C:/foo/test.dart';
470 } 470 }
471 expect(source.encoding, expected); 471 expect(source.encoding, expected);
472 } 472 }
473 473
474 void test_equals_false_differentFile() { 474 void test_equals_false_differentFile() {
475 File fileA = provider.newFile(provider.convertPath('/foo/a.dart'), ''); 475 File fileA = provider.newFile(provider.convertPath('/foo/a.dart'), '');
476 File fileB = provider.newFile(provider.convertPath('/foo/b.dart'), ''); 476 File fileB = provider.newFile(provider.convertPath('/foo/b.dart'), '');
477 Source sourceA = fileA.createSource(); 477 Source sourceA = fileA.createSource();
478 Source sourceB = fileB.createSource(); 478 Source sourceB = fileB.createSource();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 } 545 }
546 546
547 void test_contents() { 547 void test_contents() {
548 expect(() { 548 expect(() {
549 source.contents; 549 source.contents;
550 }, throwsA(_isFileSystemException)); 550 }, throwsA(_isFileSystemException));
551 } 551 }
552 552
553 void test_encoding() { 553 void test_encoding() {
554 String expected = 'file:///foo/test.dart'; 554 String expected = 'file:///foo/test.dart';
555 if (provider.pathContext == windows) { 555 if (provider.pathContext.style == windows.style) {
556 expected = 'file:///C:/foo/test.dart'; 556 expected = 'file:///C:/foo/test.dart';
557 } 557 }
558 expect(source.encoding, expected); 558 expect(source.encoding, expected);
559 } 559 }
560 560
561 void test_exists() { 561 void test_exists() {
562 expect(source.exists(), isFalse); 562 expect(source.exists(), isFalse);
563 } 563 }
564 564
565 void test_fullName() { 565 void test_fullName() {
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 return new Future.delayed(Duration.ZERO, computation); 770 return new Future.delayed(Duration.ZERO, computation);
771 } 771 }
772 772
773 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { 773 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) {
774 Folder folder = provider.getResource(path); 774 Folder folder = provider.getResource(path);
775 var changesReceived = <WatchEvent>[]; 775 var changesReceived = <WatchEvent>[];
776 folder.changes.listen(changesReceived.add); 776 folder.changes.listen(changesReceived.add);
777 return test(changesReceived); 777 return test(changesReceived);
778 } 778 }
779 } 779 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/sdk/sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698