Skip to content

Commit

Permalink
Fix printing on v.17 (#2626)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jun 16, 2021
1 parent 2ff880d commit 9c4dbfd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/src/manual/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ julia> a = 0
0
julia> @SDconstraint(model, [x x; x x] >= a)
ERROR: Operation `-` between `Array{VariableRef,2}` and `Int64` is not allowed. You should use broadcast.
ERROR: Operation `MutableArithmetics.sub_mul` between `Array{VariableRef,2}` and `Int64` is not allowed. You should use broadcast.
[...]
```

Expand Down
14 changes: 10 additions & 4 deletions test/Containers/SparseAxisArray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ $(SparseAxisArray{Int,1,Tuple{Symbol}}) with 2 entries:
@testset "Printing" begin
@test sprint(summary, d) == """
$(SparseAxisArray{Float64,2,Tuple{Symbol,Char}}) with 2 entries"""
@test sprint(show, "text/plain", d) == """
$(SparseAxisArray{Float64,2,Tuple{Symbol,Char}}) with 2 entries:
[b, v] = 0.5
[a, u] = 2.0"""
have = sprint(show, "text/plain", d)
want_A = """
$(SparseAxisArray{Float64,2,Tuple{Symbol,Char}}) with 2 entries:
[b, v] = 0.5
[a, u] = 2.0"""
want_B = """
$(SparseAxisArray{Float64,2,Tuple{Symbol,Char}}) with 2 entries:
[a, u] = 2.0
[b, v] = 0.5"""
@test have == want_A || have == want_B
end
d2 = @inferred SA(Dict((:b, 'v') => 1.0, (:a, 'u') => 4.0))
d3 = @inferred SA(Dict((:a, 'u') => 6.0, (:b, 'v') => 1.5))
Expand Down

0 comments on commit 9c4dbfd

Please sign in to comment.