mollusk 019f8e3064 Add: julia-0.6.2
Former-commit-id: ccc667cf67d569f3fb3df39aa57c2134755a7551
2018-02-10 10:27:19 -07:00

23 lines
740 B
Julia

# This file is a part of Julia. License is MIT: https://julialang.org/license
# tests the output of the embedding example is correct
using Base.Test
@test length(ARGS) == 1
@testset "embedding example" begin
stdout = Pipe()
stderr = Pipe()
p = spawn(pipeline(Cmd(ARGS), stdin=DevNull, stdout=stdout, stderr=stderr))
close(stdout.in)
close(stderr.in)
stdout_task = @async readlines(stdout)
stderr = readstring(stderr)
@test stderr == "MethodError: no method matching this_function_has_no_methods()\n"
@test success(p)
lines = wait(stdout_task)
@test length(lines) == 9
@test parse(Float64, lines[1]) sqrt(2)
@test lines[8] == "called bar"
@test lines[9] == "calling new bar"
end