Skip to content

Commit

Permalink
Merge pull request #8 from pixel27/main
Browse files Browse the repository at this point in the history
Upgrade to Julia 1.8
  • Loading branch information
pixel27 authored Oct 26, 2022
2 parents d6a14bb + 04c2c5f commit 8f9313f
Show file tree
Hide file tree
Showing 41 changed files with 266 additions and 266 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1.6
version: 1.8
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Tesseract_jll = "efd95c89-babc-5260-8753-618084eaf9d7"

[compat]
HTTP = "0.9"
HTTP = "1.5"
JSON = "0.21"
Leptonica_jll = "1.82.0"
Tesseract_jll = "5.1.0"
julia = "1.6"
julia = "1.8"
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_bmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function pix_write_bmp(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_gif.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function pix_write_gif(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/leptonica/pix/rw_jp2k.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function pix_read_jp2k(
end

# If a box was provided allocate a box.
if box != nothing
if box !== nothing
boxPtr = ccall(
(:boxCreate, LEPTONICA),
Ptr{Cvoid},
Expand All @@ -67,7 +67,7 @@ function pix_read_jp2k(
)
end

if box != nothing && boxPtr == C_NULL
if box !== nothing && boxPtr == C_NULL
return nothing
end

Expand Down Expand Up @@ -177,7 +177,7 @@ function pix_read_jp2k(
end

# If a box was provided allocate a box.
if box != nothing
if box !== nothing
boxPtr = ccall(
(:boxCreate, LEPTONICA),
Ptr{Cvoid},
Expand All @@ -186,7 +186,7 @@ function pix_read_jp2k(
)
end

if box != nothing && boxPtr == C_NULL
if box !== nothing && boxPtr == C_NULL
return nothing
end

Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_pam.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function pix_write_pam(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_pdf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function pix_write_pdf(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_png.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function pix_write_png(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_pnm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function pix_write_pnm(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/leptonica/pix/rw_ps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function pix_write_ps_i(

# ---------------------------------------------------------------------------------------------
# If a box was provided allocate a box.
if box != nothing
if box !== nothing
boxPtr = ccall(
(:boxCreate, LEPTONICA),
Ptr{Cvoid},
Expand All @@ -101,7 +101,7 @@ function pix_write_ps_i(
)
end

if box != nothing && boxPtr == C_NULL
if box !== nothing && boxPtr == C_NULL
return (C_NULL, 0)
end

Expand Down Expand Up @@ -206,7 +206,7 @@ function pix_write_ps(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/leptonica/pix/rw_spix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function pix_write_spix(
finally
lept_free(data)

if file != nothing
if file !== nothing
close(file)
end
end
Expand Down
6 changes: 3 additions & 3 deletions src/tesseract/datafiles/languages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ function parse_languages(
local files = get_json_safe(AbstractVector, json, "files")

version === nothing && return Languages()
lastcheck == nothing && return Languages()
server == nothing && return Languages()
files == nothing && return Languages()
lastcheck === nothing && return Languages()
server === nothing && return Languages()
files === nothing && return Languages()

# -------------------------------------------------------------------------------------
# Check the version.
Expand Down
6 changes: 3 additions & 3 deletions src/tesseract/tess_inst_config_vars.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ function TessParam(
local debug = findfirst("debug", name) !== nothing ||
findfirst("display", name) !== nothing

if match(r"^-?[0-9]+\.[0-9]+$", value) != nothing
if match(r"^-?[0-9]+\.[0-9]+$", value) !== nothing
return TessParam{Float64}(name, parse(Float64, value), help, debug)
elseif match(r"^-?[0-9]+$", value) != nothing
elseif match(r"^-?[0-9]+$", value) !== nothing
return TessParam{Int32}(name, parse(Int32, value), help, debug)
else
return TessParam{String}(name, value, help, debug)
Expand Down Expand Up @@ -131,7 +131,7 @@ function tess_params_parsed(
local params = Vector{TessParam}()
local data = tess_params(inst)

if data != nothing
if data !== nothing
for m in eachmatch(r"([a-z0-9_]+)\t([^\t]*)\t([^\n]+)"sm, data)
local name, value, help = m.captures
push!(params, TessParam(name, value, help))
Expand Down
2 changes: 1 addition & 1 deletion src/tesseract/tess_inst_output_tsv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function tess_parsed_tsv(
)::Union{Vector{Tsv}, Nothing}
local text = tess_tsv(inst, page)

if text == nothing
if text === nothing
return nothing
end

Expand Down
12 changes: 6 additions & 6 deletions test/leptonica/pix/bmp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
local original = pix_write_pam(pix)

function unchanged(test)
test != nothing && pix_write_pam(test) == original
test !== nothing && pix_write_pam(test) == original
end

# ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -70,19 +70,19 @@ end
# -----------------------------------------------------------------------------------------
# From a file.
local filename = safe_tmp_file()
@test pix_read_bmp(filename) == nothing
@test pix_read_bmp("xyzzy.bmp") == nothing
@test pix_read_bmp(filename) === nothing
@test pix_read_bmp("xyzzy.bmp") === nothing
rm(filename)

# -----------------------------------------------------------------------------------------
# From an IOBuffer.
local buffer = IOBuffer()
@test pix_read_bmp(buffer) == nothing
@test pix_read_bmp(buffer) === nothing

# -----------------------------------------------------------------------------------------
# To/From a byte array.
local bytes = Vector{UInt8}()
@test pix_read_bmp(bytes) == nothing
@test pix_read_bmp(bytes) === nothing
end
end

Expand All @@ -106,5 +106,5 @@ end

# ---------------------------------------------------------------------------------------------
# To a byte array.
@test (@test_logs (:error, err) pix_write_bmp(pix)) == nothing
@test (@test_logs (:error, err) pix_write_bmp(pix)) === nothing
end
2 changes: 1 addition & 1 deletion test/leptonica/pix/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ end

pix_delete!(pix)

@test (@test_logs (:error, err) pix_get_dimensions(pix)) == nothing
@test (@test_logs (:error, err) pix_get_dimensions(pix)) === nothing
end
18 changes: 9 additions & 9 deletions test/leptonica/pix/gif.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# To/From a file.
local filename = safe_tmp_file()
@test pix_write_gif(filename, pix) == true
@test pix_read_gif(filename) != nothing
@test pix_read_gif(filename) !== nothing
rm(filename)

# ---------------------------------------------------------------------------------------------
Expand All @@ -39,7 +39,7 @@
@test pix_write_gif(buffer, pix) == true
@test position(buffer) != 0
seekstart(buffer)
@test pix_read_gif(buffer) != nothing
@test pix_read_gif(buffer) !== nothing

# ---------------------------------------------------------------------------------------------
# To/From an IOStream
Expand All @@ -48,15 +48,15 @@
@test pix_write_gif(file, pix) == true
@test position(file) != 0
seekstart(file)
@test pix_read_gif(file) != nothing
@test pix_read_gif(file) !== nothing
close(file)
rm(filename)

# ---------------------------------------------------------------------------------------------
# To/From a byte array.
local bytes = pix_write_gif(pix)
@test length(bytes) > 0
@test pix_read_gif(bytes) != nothing
@test pix_read_gif(bytes) !== nothing
end

# =================================================================================================
Expand All @@ -66,19 +66,19 @@ end
# -----------------------------------------------------------------------------------------
# From a file.
local filename = safe_tmp_file()
@test pix_read_gif(filename) == nothing
@test pix_read_gif("xyzzy.gif") == nothing
@test pix_read_gif(filename) === nothing
@test pix_read_gif("xyzzy.gif") === nothing
rm(filename)

# -----------------------------------------------------------------------------------------
# From an IOBuffer.
local buffer = IOBuffer()
@test pix_read_gif(buffer) == nothing
@test pix_read_gif(buffer) === nothing

# -----------------------------------------------------------------------------------------
# To/From a byte array.
local bytes = Vector{UInt8}()
@test pix_read_gif(bytes) == nothing
@test pix_read_gif(bytes) === nothing
end
end

Expand All @@ -102,5 +102,5 @@ end

# ---------------------------------------------------------------------------------------------
# To a byte array.
@test (@test_logs (:error, err) pix_write_gif(pix)) == nothing
@test (@test_logs (:error, err) pix_write_gif(pix)) === nothing
end
Loading

0 comments on commit 8f9313f

Please sign in to comment.