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

Side by Side Diff: pkg/analyzer/test/generated/all_the_rest_test.dart

Issue 857283003: Addition of the new flag "file-read-mode" into the analysis server to fix the offset bug with Intel… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comments addressed Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.all_the_rest_test; 8 library engine.all_the_rest_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
11 11
12 import 'package:analyzer/file_system/physical_file_system.dart';
12 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; 13 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator;
13 import 'package:analyzer/src/generated/constant.dart'; 14 import 'package:analyzer/src/generated/constant.dart';
14 import 'package:analyzer/src/generated/element.dart'; 15 import 'package:analyzer/src/generated/element.dart';
15 import 'package:analyzer/src/generated/engine.dart'; 16 import 'package:analyzer/src/generated/engine.dart';
16 import 'package:analyzer/src/generated/error.dart'; 17 import 'package:analyzer/src/generated/error.dart';
17 import 'package:analyzer/src/generated/html.dart' as ht; 18 import 'package:analyzer/src/generated/html.dart' as ht;
18 import 'package:analyzer/src/generated/java_core.dart'; 19 import 'package:analyzer/src/generated/java_core.dart';
19 import 'package:analyzer/src/generated/java_engine.dart'; 20 import 'package:analyzer/src/generated/java_engine.dart';
20 import 'package:analyzer/src/generated/java_engine_io.dart'; 21 import 'package:analyzer/src/generated/java_engine_io.dart';
21 import 'package:analyzer/src/generated/java_io.dart'; 22 import 'package:analyzer/src/generated/java_io.dart';
(...skipping 7355 matching lines...) Expand 10 before | Expand all | Expand 10 after
7377 FileBasedSource source = new FileBasedSource.con1(file); 7378 FileBasedSource source = new FileBasedSource.con1(file);
7378 expect(source.fullName, file.getAbsolutePath()); 7379 expect(source.fullName, file.getAbsolutePath());
7379 } 7380 }
7380 7381
7381 void test_getShortName() { 7382 void test_getShortName() {
7382 JavaFile file = FileUtilities2.createFile("/does/not/exist.dart"); 7383 JavaFile file = FileUtilities2.createFile("/does/not/exist.dart");
7383 FileBasedSource source = new FileBasedSource.con1(file); 7384 FileBasedSource source = new FileBasedSource.con1(file);
7384 expect(source.shortName, "exist.dart"); 7385 expect(source.shortName, "exist.dart");
7385 } 7386 }
7386 7387
7388 void test_fileReadMode() {
7389 expect(FileBasedSource.fileReadMode('a'), 'a');
7390 expect(FileBasedSource.fileReadMode('a\n'), 'a\n');
7391 expect(FileBasedSource.fileReadMode('ab'), 'ab');
7392 expect(FileBasedSource.fileReadMode('abc'), 'abc');
7393 expect(FileBasedSource.fileReadMode('a\nb'), 'a\nb');
7394 expect(FileBasedSource.fileReadMode('a\rb'), 'a\rb');
7395 expect(FileBasedSource.fileReadMode('a\r\nb'), 'a\r\nb');
7396 }
7397
7398 void test_fileReadMode_changed() {
7399 FileBasedSource.fileReadMode = (String s) => s + 'xyz';
7400 expect(FileBasedSource.fileReadMode('a'), 'axyz');
7401 expect(FileBasedSource.fileReadMode('a\n'), 'a\nxyz');
7402 expect(FileBasedSource.fileReadMode('ab'), 'abxyz');
7403 expect(FileBasedSource.fileReadMode('abc'), 'abcxyz');
7404 FileBasedSource.fileReadMode = (String s) => s;
7405 }
7406
7407 void test_fileReadMode_normalize_eol_always() {
7408 FileBasedSource.fileReadMode =
7409 PhysicalResourceProvider.NORMALIZE_EOL_ALWAYS;
7410 expect(FileBasedSource.fileReadMode('a'), 'a');
7411
7412 // '\n' -> '\n' as first, last and only character
7413 expect(FileBasedSource.fileReadMode('\n'), '\n');
7414 expect(FileBasedSource.fileReadMode('a\n'), 'a\n');
7415 expect(FileBasedSource.fileReadMode('\na'), '\na');
7416
7417 // '\r\n' -> '\n' as first, last and only character
7418 expect(FileBasedSource.fileReadMode('\r\n'), '\n');
7419 expect(FileBasedSource.fileReadMode('a\r\n'), 'a\n');
7420 expect(FileBasedSource.fileReadMode('\r\na'), '\na');
7421
7422 // '\r' -> '\n' as first, last and only character
7423 expect(FileBasedSource.fileReadMode('\r'), '\n');
7424 expect(FileBasedSource.fileReadMode('a\r'), 'a\n');
7425 expect(FileBasedSource.fileReadMode('\ra'), '\na');
7426
7427 FileBasedSource.fileReadMode = (String s) => s;
7428 }
7429
7387 void test_hashCode() { 7430 void test_hashCode() {
7388 JavaFile file1 = FileUtilities2.createFile("/does/not/exist.dart"); 7431 JavaFile file1 = FileUtilities2.createFile("/does/not/exist.dart");
7389 JavaFile file2 = FileUtilities2.createFile("/does/not/exist.dart"); 7432 JavaFile file2 = FileUtilities2.createFile("/does/not/exist.dart");
7390 FileBasedSource source1 = new FileBasedSource.con1(file1); 7433 FileBasedSource source1 = new FileBasedSource.con1(file1);
7391 FileBasedSource source2 = new FileBasedSource.con1(file2); 7434 FileBasedSource source2 = new FileBasedSource.con1(file2);
7392 expect(source2.hashCode, source1.hashCode); 7435 expect(source2.hashCode, source1.hashCode);
7393 } 7436 }
7394 7437
7395 void test_isInSystemLibrary_contagious() { 7438 void test_isInSystemLibrary_contagious() {
7396 JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory; 7439 JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
8826 } else { 8869 } else {
8827 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); 8870 expect(scriptSource, isNotNull, reason: "script $scriptIndex");
8828 String actualExternalScriptName = scriptSource.shortName; 8871 String actualExternalScriptName = scriptSource.shortName;
8829 expect( 8872 expect(
8830 actualExternalScriptName, 8873 actualExternalScriptName,
8831 _expectedExternalScriptName, 8874 _expectedExternalScriptName,
8832 reason: "script $scriptIndex"); 8875 reason: "script $scriptIndex");
8833 } 8876 }
8834 } 8877 }
8835 } 8878 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/source_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698