Skip to content

Commit

Permalink
Changed pretty printing
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed May 14, 2019
1 parent 8d50f48 commit 3925fb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ function show(io::IO,::Type{<:VectorValue{D,T}}) where {D,T}
print(io,"VectorValue{$D,$T}")
end

function show(io::IO,v::MultiValue)
print(io,typeof(v))
print(io,v.array.data)
end

6 changes: 3 additions & 3 deletions test/TypesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ g = VectorValue(1,2,3,4)

# Custom type printing

s = "MultiValue{Tuple{3,2},Float64}([1.0 4.0; 2.0 5.0; 3.0 6.0])"
s = "MultiValue{Tuple{3,2},Float64}(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)"
@test string(v) == s

s = "TensorValue{2,Int64}([1 3; 2 4])"
s = "TensorValue{2,Int64}(1, 2, 3, 4)"
@test string(t) == s

s = "VectorValue{4,Int64}([1, 2, 3, 4])"
s = "VectorValue{4,Int64}(1, 2, 3, 4)"
@test string(g) == s

end # module NDimValuesTests

0 comments on commit 3925fb6

Please sign in to comment.