Add tests for problem with newline encoding in multiline strings.
R=karlklose@google.com Review URL: https://codereview.chromium.org//1252443002.
This commit is contained in:
@@ -16,6 +16,9 @@ tests/compiler/dart2js_extra/string_interpolation_dynamic_test.dart -text
|
||||
tests/compiler/dart2js_extra/literal_string_juxtaposition_test.dart -text
|
||||
tests/language/raw_string_test.dart -text
|
||||
tests/language/multiline_strings_test.dart -text
|
||||
tests/language/multiline_newline_cr.dart -text
|
||||
tests/language/multiline_newline_crlf.dart -text
|
||||
tests/language/multiline_newline_lf.dart -text
|
||||
tests/lib/convert/json_pretty_test.dart -text
|
||||
tests/lib/mirrors/method_mirror_source_line_ending_test.dart -text
|
||||
tests/lib/mirrors/method_mirror_source_line_ending_cr.dart -text
|
||||
|
||||
@@ -76,6 +76,13 @@ mixin_super_constructor_named_test/01: MissingCompileTimeError # Issue 19576
|
||||
mixin_super_constructor_positionals_test/01: MissingCompileTimeError # Issue 19576
|
||||
reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
|
||||
|
||||
multiline_newline_test/01: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/02: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/03: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/04: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/05: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/06: MissingCompileTimeError # Issue 23888
|
||||
|
||||
# Please add new failing tests before this line.
|
||||
# Section below is for invalid tests.
|
||||
#
|
||||
|
||||
@@ -32,6 +32,13 @@ external_test/25: Fail
|
||||
constructor_duplicate_final_test/03: Fail
|
||||
reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
|
||||
|
||||
multiline_newline_test/01: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/02: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/03: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/04: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/05: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/06: MissingCompileTimeError # Issue 23888
|
||||
|
||||
# Please add new failing tests before this line.
|
||||
# Section below is for invalid tests.
|
||||
#
|
||||
|
||||
@@ -77,6 +77,14 @@ const_error_multiply_initialized_test/04: CompileTimeError # Issue 23618
|
||||
# VM specific tests that should not be run by dart2js.
|
||||
vm/*: Skip # Issue 12699
|
||||
|
||||
multiline_newline_test/01: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/02: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/03: CompileTimeError # Issue 23888
|
||||
multiline_newline_test/04: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/05: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/06: MissingCompileTimeError # Issue 23888
|
||||
multiline_newline_test/none: RuntimeError # Issue 23888
|
||||
|
||||
[ $compiler == dart2js && $checked ]
|
||||
type_variable_bounds_test/02: Fail # Issue 12702
|
||||
type_variable_bounds2_test/01: Fail # Issue 12702
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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.
|
||||
|
||||
library multiline_newline_crlf;
|
||||
|
||||
const constantMultilineString = """
|
||||
a
|
||||
b
|
||||
""";
|
||||
|
||||
var nonConstantMultilineString = """
|
||||
a
|
||||
b
|
||||
""";
|
||||
@@ -0,0 +1,15 @@
|
||||
// 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.
|
||||
|
||||
library multiline_newline_lf;
|
||||
|
||||
const constantMultilineString = """
|
||||
a
|
||||
b
|
||||
""";
|
||||
|
||||
var nonConstantMultilineString = """
|
||||
a
|
||||
b
|
||||
""";
|
||||
@@ -0,0 +1,57 @@
|
||||
// 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';
|
||||
import 'multiline_newline_cr.dart' as cr;
|
||||
import 'multiline_newline_crlf.dart' as crlf;
|
||||
import 'multiline_newline_lf.dart' as lf;
|
||||
|
||||
main() {
|
||||
Expect.equals(4, cr.constantMultilineString.length);
|
||||
Expect.equals(4, crlf.constantMultilineString.length);
|
||||
Expect.equals(4, lf.constantMultilineString.length);
|
||||
Expect.equals(cr.constantMultilineString, crlf.constantMultilineString);
|
||||
Expect.equals(crlf.constantMultilineString, lf.constantMultilineString);
|
||||
Expect.equals(lf.constantMultilineString, cr.constantMultilineString);
|
||||
|
||||
Expect.equals(4, cr.nonConstantMultilineString.length);
|
||||
Expect.equals(4, crlf.nonConstantMultilineString.length);
|
||||
Expect.equals(4, lf.nonConstantMultilineString.length);
|
||||
Expect.equals(cr.nonConstantMultilineString, crlf.nonConstantMultilineString);
|
||||
Expect.equals(crlf.nonConstantMultilineString, lf.nonConstantMultilineString);
|
||||
Expect.equals(lf.nonConstantMultilineString, cr.nonConstantMultilineString);
|
||||
|
||||
const c1 =
|
||||
cr.constantMultilineString == crlf.constantMultilineString ? true : null;
|
||||
const c2 =
|
||||
crlf.constantMultilineString == lf.constantMultilineString ? true : null;
|
||||
const c3 =
|
||||
lf.constantMultilineString == cr.constantMultilineString ? true : null;
|
||||
Expect.isTrue(c1);
|
||||
Expect.isTrue(c2);
|
||||
Expect.isTrue(c3);
|
||||
|
||||
const c4 = c1 ? 1 : 2; /// 01: ok
|
||||
Expect.equals(1, c4); /// 01: continued
|
||||
|
||||
const c5 = c2 ? 2 : 3; /// 02: ok
|
||||
Expect.equals(2, c5); /// 02: continued
|
||||
|
||||
const c6 = c3 ? 3 : 4; /// 03: ok
|
||||
Expect.equals(3, c6); /// 03: continued
|
||||
|
||||
const c7 =
|
||||
cr.constantMultilineString != crlf.constantMultilineString ? true : null;
|
||||
const c8 =
|
||||
crlf.constantMultilineString != lf.constantMultilineString ? true : null;
|
||||
const c9 =
|
||||
lf.constantMultilineString != cr.constantMultilineString ? true : null;
|
||||
Expect.isNull(c7);
|
||||
Expect.isNull(c8);
|
||||
Expect.isNull(c9);
|
||||
|
||||
const c10 = c7 ? 1 : 2; /// 04: compile-time error
|
||||
const c11 = c8 ? 2 : 3; /// 05: compile-time error
|
||||
const c12 = c9 ? 3 : 4; /// 06: compile-time error
|
||||
}
|
||||
Reference in New Issue
Block a user