Skip to content

Commit 8e508dc

Browse files
committed
Format
1 parent d0ed558 commit 8e508dc

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensors"
22
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5"
33
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>", "Miles Stoudenmire <mstoudenmire@flatironinstitute.org>"]
4-
version = "0.9.14"
4+
version = "0.9.15"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

test/base/test_itensor.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ using ITensors:
77
ITensor,
88
Order,
99
QN,
10+
TagSet,
1011
,
1112
δ,
1213
addtags,
@@ -102,6 +103,24 @@ end
102103
@test storage(A) isa NDTensors.EmptyStorage{NDTensors.EmptyNumber}
103104
end
104105

106+
@testset "show" begin
107+
i = Index{Int}(1, 2, ITensors.Neither, TagSet(), 0)
108+
a = ITensor([1, 2], i)
109+
function res_show(prefix = "")
110+
return "ITensor ord=1\nDim 1: (dim=2|id=1)\n" *
111+
"$(prefix)Dense{Float64, Vector{Float64}}\n" *
112+
" 2-element\n 1.0\n 2.0\n"
113+
end
114+
@test sprint(show, a) in (res_show(), res_show("NDTensors."))
115+
@test sprint(show, a; context = :compact => true) == "((dim=2|id=1),)"
116+
function res_show_text(prefix = "")
117+
return "ITensor ord=1 (dim=2|id=1)\n" *
118+
"$(prefix)Dense{Float64, Vector{Float64}}"
119+
end
120+
@test sprint(show, MIME"text/plain"(), a) in
121+
(res_show_text(), res_show_text("NDTensors."))
122+
end
123+
105124
@testset "diag" for ElType in (Float32, Float64, ComplexF32, ComplexF64)
106125
i, j = Index.(2, ("i", "j"))
107126
A = random_itensor(ElType, i, j)

0 commit comments

Comments
 (0)