Skip to content

Commit

Permalink
Tests for newline stripping
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 25, 2024
1 parent 99d18f1 commit 05b9d5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/Runic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 05b9d5b

Please sign in to comment.