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

Side by Side Diff: tests/lib/mirrors/method_mirror_source_line_ending_test.dart

Issue 132773006: Fix handling of CRLF line endings in Script::GetSnippet. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: appease analyzer Created 6 years, 10 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 | « tests/lib/mirrors/method_mirror_source_line_ending_lf.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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "dart:mirrors";
6 import "package:expect/expect.dart";
7
8 import "method_mirror_source_line_ending_lf.dart";
9 import "method_mirror_source_line_ending_cr.dart";
10 import "method_mirror_source_line_ending_crlf.dart";
11
12 main() {
13 String sourceOf(Function f) => (reflect(f) as ClosureMirror).function.source;
14
15 // Source does not cross line breaks.
16 Expect.stringEquals('oneLineLF(x) => x;', sourceOf(oneLineLF));
17 Expect.stringEquals('oneLineCR(x) => x;', sourceOf(oneLineCR));
18 Expect.stringEquals('oneLineCRLF(x) => x;', sourceOf(oneLineCRLF));
19
20 // Source includes line breaks.
21 Expect.stringEquals('multiLineLF(y) {\n return y + 1;\n}',
22 sourceOf(multiLineLF));
23 Expect.stringEquals('multiLineCR(y) {\r return y + 1;\r}',
24 sourceOf(multiLineCR));
25 Expect.stringEquals('multiLineCRLF(y) {\r\n return y + 1;\r\n}',
26 sourceOf(multiLineCRLF));
27
28 // First and last characters separated from middle by line breaks.
29 Expect.stringEquals('a\n(){\n}', sourceOf(a));
30 Expect.stringEquals('b\r(){\r}', sourceOf(b));
31 Expect.stringEquals('c\r\n(){\r\n}', sourceOf(c));
32 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/method_mirror_source_line_ending_lf.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698