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

Unified Diff: tests/language/multiline_strings_test.dart

Issue 1042523004: Add a test for trimming leading whitespace in multiline strings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/multiline_strings_test.dart
diff --git a/tests/language/multiline_strings_test.dart b/tests/language/multiline_strings_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..d7f8f3e5d03946957477ef8ab7530f3e2aabc603
--- /dev/null
+++ b/tests/language/multiline_strings_test.dart
@@ -0,0 +1,44 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+main() {
+ Expect.equals('foo', '''
+foo''');
+
+ Expect.equals('\\\nfoo', '''\\
hausner 2015/03/31 22:15:36 I believe this expectation is wrong. The Spec esse
hausner 2015/03/31 22:33:04 My bad. This expectation is right.
+foo''');
+
+ Expect.equals('\t\nfoo', '''\t
+foo''');
hausner 2015/03/31 22:33:04 This multiline string should be equal to 'foo', si
Paul Berry 2015/03/31 23:33:03 The relevant spec text is: "If the first line of a
gbracha 2015/04/02 19:25:57 The idea was (I believe) to ignore invisible stuff
+
+ Expect.equals('foo', '''\
+foo''');
+
+ Expect.equals('foo', '''\ \
+foo''');
+
+ Expect.equals(' \nfoo', '''\x20
+foo''');
+
+ String x = ' ';
+ Expect.equals(' \nfoo', '''$x
+foo''');
+
+ Expect.equals('foo', r'''
+foo''');
+
+ Expect.equals('\\\\\nfoo', r'''\\
+foo''');
+
+ Expect.equals('\\t\nfoo', r'''\t
+foo''');
+
+ Expect.equals('foo', r'''\
+foo''');
+
+ Expect.equals('foo', r'''\ \
+foo''');
+}
« no previous file with comments | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698