Files
swift-mirror/test/Parse/multiline_normalize_newline.swift
Vinicius Vendramini 39d3963131 Fix broken tests
- Many tests got broken because of two things:
  - AST dump now outputs to stdout, but many tests expected stderr. This was a straightforward fix.
  - Many tests call swift with specific parameters; specifically, many call `swift frontend` directly. This makes them go through the compiler in unexpected ways, and specifically it makes them not have primary files, which breaks the new AST dump implementation. This commit adds the old implementation as a fallback for those cases, except it dumps to `stdout` to maintain some consistence.

Finally, the `/test/Driver/filelists.swift` failed for unknown reasons. It seems its output now had some lines out of order, and fixing the order made the test pass. However, as the reasons why it failed are unknown, this fix might not have been a good idea. Corrections are welcome.
2018-11-14 13:38:01 -02:00

71 lines
1.1 KiB
Swift

// RUN: %target-swift-frontend -dump-parse %s | %FileCheck %s
// CR
_ = """
"""
//CHECK: string_literal_expr {{.*}} value=""
_ = """
test
"""
//CHECK: string_literal_expr {{.*}} value="test"
// CR+LF
_ = """
"""
//CHECK: string_literal_expr {{.*}} value=""
_ = """
test
"""
//CHECK: string_literal_expr {{.*}} value="test"
// CR+LF
_ = """
"""
//CHECK: string_literal_expr {{.*}} value=""
_ = """
test
test
"""
//CHECK: string_literal_expr {{.*}} value="test\ntest"
// LF+CR
_ = """
foo
foo
"""
//CHECK: string_literal_expr {{.*}} value="\nfoo\n\nfoo\n"
// LF+CR+LF
_ = """
foo
foo
"""
//CHECK: string_literal_expr {{.*}} value="\nfoo\n\nfoo\n"
// Mixed no-indent.
_ = """
<LF
<LF
<CR
<CR+LF
"""
//CHECK: string_literal_expr {{.*}} value="<LF\n<LF\n<CR\n<CR+LF"
// Mixed indent.
_ = """
<LF
<LF
<CR
<CR+LF
"""
//CHECK: string_literal_expr {{.*}} value="<LF\n<LF\n<CR\n<CR+LF"
// Empty line CR, CR+LF, LF.
_ = """
foo
bar
"""
//CHECK: string_literal_expr {{.*}} value="foo\n\n\n\nbar"