mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:30:12 +01:00
This commit is contained in:
+2
-2
@@ -10,10 +10,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = """
|
||||
var s: String = '''
|
||||
A "block" ""string"" literal
|
||||
with indent.
|
||||
""";
|
||||
''';
|
||||
if (s == "A \"block\" \"\"string\"\" literal\n with indent.\n") {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = """
|
||||
var s: String = '''
|
||||
A block string literal
|
||||
\"""
|
||||
""";
|
||||
if (s == "A block string literal\n\"\"\"\n") {
|
||||
\'''
|
||||
''';
|
||||
if (s == "A block string literal\n'''\n") {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = """filetype
|
||||
var s: String = '''filetype
|
||||
A "block" ""string"" literal
|
||||
with file type indicator.
|
||||
""";
|
||||
''';
|
||||
if (s == "A \"block\" \"\"string\"\" literal\n with file type indicator.\n") {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon:[[@LINE+1]]: Invalid block string: Should end with triple quotes: error: closing """
|
||||
var s: String = """
|
||||
error: closing """ is not on its own line.
|
||||
""";
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_block_quotes_not_on_own_line.carbon:[[@LINE+1]]: Invalid block string: Should end with triple quotes: error: closing '''
|
||||
var s: String = '''
|
||||
error: closing ''' is not on its own line.
|
||||
''';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_raw_block_more_hash_tags_on_left.carbon:[[@LINE+1]]: Unexpected end of file
|
||||
var s: String = ##"""
|
||||
var s: String = ##'''
|
||||
error: there are more #s on the left than the right.
|
||||
"""#;
|
||||
'''#;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10,9 +10,9 @@ package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_raw_block_more_hash_tags_on_right.carbon:[[@LINE+1]]: invalid character '\x23' in source file.
|
||||
var s: String = #"""
|
||||
var s: String = #'''
|
||||
error: there are more #s on the right than the left.
|
||||
"""##;
|
||||
'''##;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_raw_block_quotes_not_on_own_line.carbon:[[@LINE+1]]: Invalid block string: Should end with triple quotes: error: closing """
|
||||
var s: String = #"""
|
||||
error: closing """# is not on its own line.
|
||||
"""#;
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_raw_block_quotes_not_on_own_line.carbon:[[@LINE+1]]: Invalid block string: Should end with triple quotes: error: closing '''
|
||||
var s: String = #'''
|
||||
error: closing '''# is not on its own line.
|
||||
'''#;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ package ExplorerTest api;
|
||||
|
||||
fn CompareStr(s: String) -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: {{.*}}/explorer/testdata/string/fail_raw_block_single_line.carbon:[[@LINE+1]]: Invalid block string: Too few lines
|
||||
if (s == #"""raw string literal starting with """#) {
|
||||
if (s == #'''raw string literal starting with '''#) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
||||
+2
-2
@@ -10,10 +10,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = #"""
|
||||
var s: String = #'''
|
||||
A "block" ""string"" literal
|
||||
with indent.
|
||||
"""#;
|
||||
'''#;
|
||||
if (s == #"A \#"block\#" \#"\#"string\#"\#" literal\#n with indent.\#n"#) {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = #"""
|
||||
var s: String = #'''
|
||||
A block string literal
|
||||
\
|
||||
"""#;
|
||||
'''#;
|
||||
if (s == "A block string literal\n\\\n") {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = #"""
|
||||
var s: String = #'''
|
||||
A block string literal
|
||||
\#"""#
|
||||
"""#;
|
||||
if (s == "A block string literal\n\"\"\"#\n") {
|
||||
\#'''#
|
||||
'''#;
|
||||
if (s == "A block string literal\n'''#\n") {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user