swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: 0ccb7fe48802c63abadf68b92a5aac43e01add48 authored by Dilum Aluthge on 02 January 2022, 17:50:47 UTC
Make `Base.prompt`, `Base.getpass`, and `Base.winprompt` part of the public API (by adding their docstrings to a manual page)
Tip revision: 0ccb7fe
interpreter.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test

# interpreted but inferred/optimized top-level expressions with vars
let code = """
           while true
               try
                   this_is_undefined_29213
                   ed = 0
                   break
               finally
                   break
               end
           end
           print(42)
           """
    @test read(`$(Base.julia_cmd()) --startup-file=no --compile=min -e $code`, String) == "42"
end

let code = "Threads.atomic_add!(Threads.Atomic{Int}(40), 2)"
    @test read(`$(Base.julia_cmd()) --startup-file=no --compile=min -E $code`, String) == "40\n"
end

let p = Pipe(),
    c = pipeline(`$(Base.julia_cmd()) --startup-file=no --compile=min -E 'error()'`, stderr=p)
    proc = run(c, wait=false)
    readline(p)
    @test readline(p) == "Stacktrace:"
    wait(proc)
    close(p)
end
back to top