Skip to content

Commit

Permalink
Merge pull request jump-dev#2151 from JuliaOpt/bl/j1.4
Browse files Browse the repository at this point in the history
Fix tests for Julia v1.4-rc1
  • Loading branch information
blegat authored Feb 5, 2020
2 parents c404d33 + 343b64c commit 088ae5b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ julia:
- 1.1
- 1.2
- 1.3
- 1.4
# This is left as an example for the next big version switch.
# matrix:
# allow_failures:
Expand Down
7 changes: 4 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
environment:
matrix:
# - julia_version: 1.0 # Disabled to speed up CI, tested on Linux with Travis
- julia_version: 1.1
- julia_version: 1.2
- julia_version: 1.0
# - julia_version: 1.1 # Disabled to speed up CI, tested on Linux with Travis
# - julia_version: 1.2 # Disabled to speed up CI, tested on Linux with Travis
- julia_version: 1.3
- julia_version: 1.4

platform:
- x86 # 32-bit
Expand Down
6 changes: 3 additions & 3 deletions test/Containers/DenseAxisArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ And data, a 2-element Array{Float64,1}:
correct_answer = DenseAxisArray([2.0, 3.0], [:a, :b])
@test sprint(show, correct_answer) == """
1-dimensional DenseAxisArray{Float64,1,...} with index sets:
Dimension 1, Symbol[:a, :b]
Dimension 1, $([:a, :b])
And data, a 2-element Array{Float64,1}:
2.0
3.0"""
Expand Down Expand Up @@ -102,7 +102,7 @@ And data, a 2-element Array{Float64,1}:
@test sprint(show, A) == """
2-dimensional DenseAxisArray{$Int,2,...} with index sets:
Dimension 1, 2:3
Dimension 2, Symbol[:a, :b]
Dimension 2, $([:a, :b])
And data, a 2×2 Array{$Int,2}:
1 2
3 4"""
Expand All @@ -128,7 +128,7 @@ And data, a 2×2 Array{$Int,2}:
@test sprint(show, A) == """
4-dimensional DenseAxisArray{Float64,4,...} with index sets:
Dimension 1, 2:3
Dimension 2, Symbol[:a, :b]
Dimension 2, $([:a, :b])
Dimension 3, -1:0
Dimension 4, ["a", "b"]
And data, a 2×2×2×2 Array{Float64,4}:
Expand Down
7 changes: 5 additions & 2 deletions test/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,11 @@ end
@testset "Warn on unexpected assignment" begin
m = Model()
@variable(m, x)
# function getindex does not accept keyword arguments
@test_throws ErrorException x[i=1]
# Julia v1.0 -> v1.3
# ERROR: function getindex does not accept keyword arguments
# Julia v1.3 onwards
# ERROR: MethodError: no method matching getindex(::VariableRef; i=1)
@test_throws Union{ErrorException, MethodError} x[i=1]
err = ErrorException("Unexpected assignment in expression `x[i=1]`.")
@test_macro_throws ErrorException @constraint(m, x[i=1] <= 1)
end
Expand Down

0 comments on commit 088ae5b

Please sign in to comment.