From d4bf236bb025ee0bcde5905242b2fe074da7221f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20A=2E=20P=C3=A9rez-Hern=C3=A1ndez?= Date: Fri, 6 Sep 2019 14:05:11 -0500 Subject: [PATCH] Update to julia >= 1.3 --- .appveyor.yml | 9 ++++----- .travis.yml | 9 ++++----- Project.toml | 4 ++-- src/Expect.jl | 6 +++--- test/test_timeout.jl | 2 +- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index df7b266..f686a35 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - julia_version: 1.2 - julia_version: 1.3 - julia_version: nightly @@ -8,10 +7,10 @@ platform: - x86 # 32-bit - x64 # 64-bit -matrix: - allow_failures: - - julia_version: 1.3 - - julia_version: nightly +# matrix: +# allow_failures: +# - julia_version: 1.3 +# - julia_version: nightly branches: only: diff --git a/.travis.yml b/.travis.yml index a89b0db..6aed436 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,12 +4,11 @@ os: - linux - osx julia: - - 1.2 - 1.3 - nightly -matrix: - allow_failures: - - julia: 1.3 - - julia: nightly +# matrix: +# allow_failures: +# - julia: 1.3 +# - julia: nightly after_success: - if [ "$TRAVIS_JULIA_VERSION" = "nightly" ]; then julia -e "cd(Pkg.dir(\"${JL_PKG}\")); Pkg.add(\"Coverage\"); using Coverage; Coveralls.submit(Coveralls.process_folder())"; fi diff --git a/Project.toml b/Project.toml index 1deca4a..77afaee 100644 --- a/Project.toml +++ b/Project.toml @@ -1,13 +1,13 @@ name = "Expect" uuid = "6a31a4e8-6e70-5a2d-b005-bc2d500d80a5" repo = "https://github.com/PerezHz/Expect.jl.git" -version = "0.2.0" +version = "0.3.0" [deps] Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" [compat] -julia = "≥ 1.1.0" +julia = "≥ 1.3.0" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/src/Expect.jl b/src/Expect.jl index 0790600..54dec8f 100644 --- a/src/Expect.jl +++ b/src/Expect.jl @@ -5,7 +5,7 @@ export ExpectTimeout, ExpectEOF ## Imports import Base.Libc: strerror -import Base: Process, TTY, wait, wait_readnb, wait_readbyte +import Base: Process, TTY, wait, wait_readnb, wait_close import Base: kill, process_running, process_exited, success import Base: write, print, println, flush, eof, close import Base: read, readbytes!, readuntil @@ -197,9 +197,9 @@ function wait_readnb(proc::ExpectProc, nb::Int; timeout::Real=proc.timeout) end end -function wait_readbyte(proc::ExpectProc, c::UInt8; timeout::Real=proc.timeout) +function wait_close(proc::ExpectProc; timeout::Real=proc.timeout) _timed_wait(proc; timeout=timeout) do - wait_readbyte(proc.in_stream, c) + @show wait_close(proc.in_stream) end end diff --git a/test/test_timeout.jl b/test/test_timeout.jl index 85f9688..19dc61e 100644 --- a/test/test_timeout.jl +++ b/test/test_timeout.jl @@ -7,7 +7,7 @@ include("prelude.jl") @test_throws ExpectTimeout readbytes!(proc, Vector{UInt8}(undef, 1)) @test_throws ExpectTimeout readuntil(proc, '\n') @test_throws ExpectTimeout Base.wait_readnb(proc, 1) - @test_throws ExpectTimeout Base.wait_readbyte(proc, UInt8('\n')) + @test_throws ExpectTimeout Base.wait_close(proc) @test_throws ExpectTimeout read(proc, String) @test_throws ExpectTimeout readline(proc) @test process_running(proc)