diff --git a/src/Runic.jl b/src/Runic.jl index 1199340..8961221 100644 --- a/src/Runic.jl +++ b/src/Runic.jl @@ -424,15 +424,6 @@ function format_tree!(ctx::Context) return nothing end -# function format_context(ctx) -# # Build the context -# ctx = Context(sourcetext) -# # Run the formatter -# fmt_tree = format_tree!(ctx) -# ctx.fmt_tree = fmt_tree -# return ctx -# end - """ format_string(str::AbstractString) -> String diff --git a/test/runtests.jl b/test/runtests.jl index 6f177f1..105e074 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,17 @@ using Runic: format_string using Test: - @test, @testset + @test, @testset, @test_broken + +@testset "Trailing whitespace" begin + io = IOBuffer() + println(io, "a = 1 ") # Trailing space + println(io, "b = 2\t") # Trailing tab + println(io, " ") # Trailing space on consecutive lines + println(io, " ") + str = String(take!(io)) + @test_broken format_string(str) == "a = 1\nb = 2\n\n\n" +end @testset "Hex/oct/bin literal integers" begin z(n) = "0"^n