Skip to content

Commit

Permalink
Merge pull request #201266 from Homebrew/kotlin-heredoc
Browse files Browse the repository at this point in the history
formulae(kotlin): use `KOTLIN` heredoc delimiter for `.kt` files
  • Loading branch information
BrewTestBot authored Dec 15, 2024
2 parents 6582225 + a54e3ef commit b99a090
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Formula/d/detekt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ def install
system bin/"detekt", "--generate-config"
assert_match "empty-blocks:", File.read(testpath/"detekt.yml")

(testpath/"input.kt").write <<~EOS
(testpath/"input.kt").write <<~KOTLIN
fun main() {
}
EOS
KOTLIN

shell_output("#{bin}/detekt --input input.kt --report txt:output.txt --config #{testpath}/detekt.yml", 2)
assert_equal "EmptyFunctionBlock", shell_output("cat output.txt").slice(/\w+/)
end
Expand Down
5 changes: 3 additions & 2 deletions Formula/k/kotlin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ def install
end

test do
(testpath/"test.kt").write <<~EOS
(testpath/"test.kt").write <<~KOTLIN
fun main(args: Array<String>) {
println("Hello World!")
}
EOS
KOTLIN

system bin/"kotlinc", "test.kt", "-include-runtime", "-d", "test.jar"
system bin/"kotlinc-jvm", "test.kt", "-include-runtime", "-d", "test.jar"
end
Expand Down
10 changes: 6 additions & 4 deletions Formula/k/ktlint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ def install
end

test do
(testpath/"Main.kt").write <<~EOS
(testpath/"Main.kt").write <<~KOTLIN
fun main( )
EOS
(testpath/"Out.kt").write <<~EOS
KOTLIN

(testpath/"Out.kt").write <<~KOTLIN
fun main()
EOS
KOTLIN

system bin/"ktlint", "-F", "Main.kt"
assert_equal shell_output("cat Main.kt"), shell_output("cat Out.kt")
end
Expand Down

0 comments on commit b99a090

Please sign in to comment.