Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with Julia 1.6 #34

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
julia-version:
- '1'
# - '1.6'
- '1.6'
- 'nightly'
fail-fast: false
steps:
Expand Down
2 changes: 2 additions & 0 deletions test/TryTests/src/test_doctest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ using Try
using TryExperimental

function test_try()
VERSION < v"1.7" && return
doctest(Try; manual = false)
end

function test_tryexperimental()
VERSION < v"1.7" && return
doctest(TryExperimental; manual = false)
end

Expand Down
13 changes: 12 additions & 1 deletion test/TryTests/src/test_tools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ using Try
using TryExperimental
using TryExperimental: @and_then, @or_else

if !@isdefined Returns
Returns(y) = function constant(_args...; _kwrags...)
return y
end
end

function trygetnitems(xs)
Try.@and_return trygetlength(xs)
Ok(count(Returns(true), xs))
Expand Down Expand Up @@ -68,7 +74,12 @@ function test_curry()
Ok("123")
end |>
Try.and_then() do x
Ok(@something(tryparse(Int, x), return Err(ErrorException(""))))
y = tryparse(Int, x)
if y === nothing
Err(ErrorException(""))
else
Ok(y)
end
end |>
Try.unwrap

Expand Down