| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |