Skip to content

Commit cea1919

Browse files
authored
Merge pull request #197022 from Homebrew/swift-heredocs
Use Swift language-specific heredoc delimiters
2 parents 2760de1 + 3613dcc commit cea1919

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Formula/b/bartycrouch.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ def install
2525
end
2626

2727
test do
28-
(testpath/"Test.swift").write <<~EOS
28+
(testpath/"Test.swift").write <<~SWIFT
2929
import Foundation
3030
3131
class Test {
3232
func test() {
3333
NSLocalizedString("test", comment: "")
3434
}
3535
}
36-
EOS
36+
SWIFT
3737

3838
(testpath/"en.lproj/Localizable.strings").write <<~EOS
3939
/* No comment provided by engineer. */

Formula/l/lizard-analyzer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def install
2525
end
2626

2727
test do
28-
(testpath/"test.swift").write <<~EOS
28+
(testpath/"test.swift").write <<~SWIFT
2929
let base = 2
3030
let exponent_inner = 3
3131
let exponent_outer = 4
@@ -36,7 +36,7 @@ def install
3636
answer *= base
3737
}
3838
}
39-
EOS
39+
SWIFT
4040

4141
assert_match "1 file analyzed.", shell_output("#{bin}/lizard -l swift #{testpath}/test.swift")
4242
end

Formula/m/mockolo.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ def install
3030
end
3131

3232
test do
33-
(testpath/"testfile.swift").write <<~EOS
33+
(testpath/"testfile.swift").write <<~SWIFT
3434
/// @mockable
3535
public protocol Foo {
3636
var num: Int { get set }
3737
func bar(arg: Float) -> String
3838
}
39-
EOS
39+
SWIFT
4040
system bin/"mockolo", "-srcs", testpath/"testfile.swift", "-d", testpath/"GeneratedMocks.swift"
4141
assert_predicate testpath/"GeneratedMocks.swift", :exist?
42-
output = <<~EOS.gsub(/\s+/, "").strip
42+
output = <<~SWIFT.gsub(/\s+/, "").strip
4343
///
4444
/// @Generated by Mockolo
4545
///
@@ -62,7 +62,7 @@ def install
6262
return ""
6363
}
6464
}
65-
EOS
65+
SWIFT
6666
assert_equal output, shell_output("cat #{testpath/"GeneratedMocks.swift"}").gsub(/\s+/, "").strip
6767
end
6868
end

Formula/n/needle.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ def install
3838
end
3939

4040
test do
41-
(testpath/"Test.swift").write <<~EOS
41+
(testpath/"Test.swift").write <<~SWIFT
4242
import Foundation
4343
4444
protocol ChildDependency: Dependency {}
4545
class Child: Component<ChildDependency> {}
4646
4747
let child = Child(parent: self)
48-
EOS
48+
SWIFT
4949

5050
assert_match "Root\n", shell_output("#{bin}/needle print-dependency-tree #{testpath}/Test.swift")
5151
assert_match version.to_s, shell_output("#{bin}/needle version")

Formula/s/swiftformat.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ def install
3131
end
3232

3333
test do
34-
(testpath/"potato.swift").write <<~EOS
34+
(testpath/"potato.swift").write <<~SWIFT
3535
struct Potato {
3636
let baked: Bool
3737
}
38-
EOS
38+
SWIFT
3939
system bin/"swiftformat", "#{testpath}/potato.swift"
4040
end
4141
end

0 commit comments

Comments
 (0)