Index: tests/language/bad_raw_string_test.dart |
diff --git a/tests/language/bad_raw_string_test.dart b/tests/language/bad_raw_string_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c3890d9ec584c7ab2349a599153ef1a0961924d |
--- /dev/null |
+++ b/tests/language/bad_raw_string_test.dart |
@@ -0,0 +1,23 @@ |
+// Copyright (c) 2016, 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. |
+ |
+main() { |
+ // Raw String may not contain newline (may not be multi-line). |
+ String x = '' |
+ r' /// 01: compile-time error |
+' /// 01: continued |
+ r" /// 02: compile-time error |
+" /// 02: continued |
+ // Test that a raw string containing just one character, a \n char, fails. |
+ // Enclose the test string in a bigger multiline string, except in case 03: |
+ ''' /// 03: compile-time error |
+ """ |
+ ''' /// 03: continued |
+ r' |
+' |
+ ''' /// 03: continued |
+ """ |
+ ''' /// 03: continued |
+ ; |
+} |