Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix hygenie print #219

Merged
merged 2 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/codegen/julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function print_help_str(x, ctx::EmitContext)
end

if ctx.configs.static
:(print($(help_str(x; color, ctx.configs.width))))
:($Base.print($(help_str(x; color, ctx.configs.width))))
else
:($print_cmd(IOContext(stdout, :color => $color), $x))
end
Expand Down
1 change: 1 addition & 0 deletions test/codegen/codegen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using Test
include("julia/vararg.jl")
include("julia/exception.jl")
include("julia/plugin.jl")
include("julia/print.jl")
end

@testset "ZSHCompletions.emit" begin
Expand Down
22 changes: 22 additions & 0 deletions test/codegen/julia/print.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module Issue218

using Test
using Comonicon

@cast function print(file)
@show file
if splitext(file)[2] == ".toml"
print("hhhh")
else
# An intentional error
error("my casted `print` is loaded!")
end
end

@main

@testset "issue#128" begin
@test Issue218.command_main(["-h"]) == 0
end

end