Skip to content

Commit

Permalink
Check input expresion in numbered prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc authored Jun 5, 2023
1 parent f407a4c commit 6a9e981
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,7 @@ function out_transform(@nospecialize(x), n::Ref{Int})
end

function get_usings!(usings, ex)
ex isa Expr || return usings
# get all `using` and `import` statements which are at the top level
for (i, arg) in enumerate(ex.args)
if Base.isexpr(arg, :toplevel)
Expand Down
4 changes: 4 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,10 @@ fake_repl() do stdin_write, stdout_read, repl
@test !contains(s, "ERROR")
@test contains(s, "Test Passed")

# Test for https://github.com/JuliaLang/julia/issues/49319
s = sendrepl2("# comment", "In [16]")
@test !contains(s, "ERROR")

write(stdin_write, '\x04')
Base.wait(repltask)
end

0 comments on commit 6a9e981

Please sign in to comment.