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

Side by Side Diff: pkg/analyzer/test/parse_compilation_unit_test.dart

Issue 45573002: Rename analyzer_experimental to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks before publishing. Created 7 years, 1 month 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
« no previous file with comments | « pkg/analyzer/test/options_test.dart ('k') | pkg/analyzer/test/services/formatter_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'package:analyzer_experimental/analyzer.dart'; 5 import 'package:analyzer/analyzer.dart';
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 7
8 void main() { 8 void main() {
9 test("parses a valid compilation unit successfully", () { 9 test("parses a valid compilation unit successfully", () {
10 var unit = parseCompilationUnit("void main() => print('Hello, world!');"); 10 var unit = parseCompilationUnit("void main() => print('Hello, world!');");
11 expect(unit.toString(), equals("void main() => print('Hello, world!');")); 11 expect(unit.toString(), equals("void main() => print('Hello, world!');"));
12 }); 12 });
13 13
14 test("throws errors for an invalid compilation unit", () { 14 test("throws errors for an invalid compilation unit", () {
15 expect(() { 15 expect(() {
16 parseCompilationUnit("void main() => print('Hello, world!')", 16 parseCompilationUnit("void main() => print('Hello, world!')",
17 name: 'test.dart'); 17 name: 'test.dart');
18 }, throwsA(predicate((error) { 18 }, throwsA(predicate((error) {
19 return error is AnalyzerErrorGroup && 19 return error is AnalyzerErrorGroup &&
20 error.toString().contains("line 1 of test.dart"); 20 error.toString().contains("line 1 of test.dart");
21 }))); 21 })));
22 }); 22 });
23 23
24 test("defaults to '<unknown source>' if no name is provided", () { 24 test("defaults to '<unknown source>' if no name is provided", () {
25 expect(() { 25 expect(() {
26 parseCompilationUnit("void main() => print('Hello, world!')"); 26 parseCompilationUnit("void main() => print('Hello, world!')");
27 }, throwsA(predicate((error) { 27 }, throwsA(predicate((error) {
28 return error is AnalyzerErrorGroup && 28 return error is AnalyzerErrorGroup &&
29 error.toString().contains("line 1 of <unknown source>"); 29 error.toString().contains("line 1 of <unknown source>");
30 }))); 30 })));
31 }); 31 });
32 } 32 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/options_test.dart ('k') | pkg/analyzer/test/services/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698