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

Side by Side Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 1167733004: Decide if unit without directives is a part or a library. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
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.src.context.context_test; 5 library test.src.context.context_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/src/cancelable_future.dart'; 9 import 'package:analyzer/src/cancelable_future.dart';
10 import 'package:analyzer/src/context/cache.dart'; 10 import 'package:analyzer/src/context/cache.dart';
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 reason: "library changed 3"); 547 reason: "library changed 3");
548 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, 548 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
549 reason: "part changed 3"); 549 reason: "part changed 3");
550 _analyzeAll_assertFinished(); 550 _analyzeAll_assertFinished();
551 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, 551 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
552 reason: "library resolved 3"); 552 reason: "library resolved 3");
553 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull, 553 expect(context.getResolvedCompilationUnit2(partSource, libSource), isNull,
554 reason: "part resolved 3"); 554 reason: "part resolved 3");
555 } 555 }
556 556
557 void fail_performAnalysisTask_changePartContents_makeItAPart() { 557 void test_performAnalysisTask_changePartContents_makeItAPart() {
558 // TODO(paulberry): fix this. It appears to be broken because of broken
559 // dependency handling with part files (see TODO comment in
560 // ContainingLibrariesTask.internalPeform)
561 Source libSource = addSource("/lib.dart", r''' 558 Source libSource = addSource("/lib.dart", r'''
562 library lib; 559 library lib;
563 part 'part.dart'; 560 part 'part.dart';
564 void f(x) {}'''); 561 void f(x) {}''');
565 Source partSource = addSource("/part.dart", "void g() { f(null); }"); 562 Source partSource = addSource("/part.dart", "void g() { f(null); }");
566 _analyzeAll_assertFinished(); 563 _analyzeAll_assertFinished();
567 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull, 564 expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
568 reason: "library resolved 1"); 565 reason: "library resolved 1");
569 expect( 566 expect(
570 context.getResolvedCompilationUnit2(partSource, libSource), isNotNull, 567 context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 : super(name, pathos.toUri(name), UriKind.FILE_URI); 2134 : super(name, pathos.toUri(name), UriKind.FILE_URI);
2138 2135
2139 @override 2136 @override
2140 TimestampedData<String> get contents { 2137 TimestampedData<String> get contents {
2141 throw 'Read error'; 2138 throw 'Read error';
2142 } 2139 }
2143 2140
2144 @override 2141 @override
2145 bool exists() => true; 2142 bool exists() => true;
2146 } 2143 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698