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

Side by Side Diff: pkg/analyzer/test/src/summary/summarize_ast_test.dart

Issue 1839633002: Fix for 'hasNoSupertype' for Object when summarize AST. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.src.summary.summarize_ast_test; 5 library analyzer.test.src.summary.summarize_ast_test;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (unit == null) { 101 if (unit == null) {
102 if (!allowMissingFiles) { 102 if (!allowMissingFiles) {
103 fail('Test referred to unknown unit $relativeUri'); 103 fail('Test referred to unknown unit $relativeUri');
104 } 104 }
105 } else { 105 } else {
106 unlinkedUnits.add(unit); 106 unlinkedUnits.add(unit);
107 } 107 }
108 } 108 }
109 } 109 }
110 110
111 test_class_no_superclass() {
112 UnlinkedClass cls = serializeClassText('part of dart.core; class Object {}',
113 className: 'Object');
114 expect(cls.supertype, isNull);
115 expect(cls.hasNoSupertype, isTrue);
116 }
117
111 CompilationUnit _parseText(String text) { 118 CompilationUnit _parseText(String text) {
112 CharSequenceReader reader = new CharSequenceReader(text); 119 CharSequenceReader reader = new CharSequenceReader(text);
113 Scanner scanner = 120 Scanner scanner =
114 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); 121 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER);
115 Token token = scanner.tokenize(); 122 Token token = scanner.tokenize();
116 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); 123 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER);
117 parser.parseGenericMethods = true; 124 parser.parseGenericMethods = true;
118 return parser.parseCompilationUnit(token); 125 return parser.parseCompilationUnit(token);
119 } 126 }
120 } 127 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698