|
87 | 87 | @test @constinferred(axes(V)) == Base.OneTo(d) |
88 | 88 | @test ℝ^d == ℝ[](d) == CartesianSpace(d) == typeof(V)(d) |
89 | 89 | W = @constinferred ℝ^1 |
| 90 | + @test @constinferred(isunitspace(W)) |
90 | 91 | @test @constinferred(unitspace(V)) == W == unitspace(typeof(V)) |
| 92 | + @test @constinferred(leftunitspace(V)) == W == @constinferred(rightunitspace(V)) |
91 | 93 | @test @constinferred(zerospace(V)) == ℝ^0 == zerospace(typeof(V)) |
92 | 94 | @test @constinferred(⊕(V, zerospace(V))) == V |
93 | 95 | @test @constinferred(⊕(V, V)) == ℝ^(2d) |
|
133 | 135 | @test @constinferred(axes(V)) == Base.OneTo(d) |
134 | 136 | @test ℂ^d == Vect[Trivial](d) == Vect[](Trivial() => d) == ℂ[](d) == typeof(V)(d) |
135 | 137 | W = @constinferred ℂ^1 |
| 138 | + @test @constinferred(isunitspace(W)) |
136 | 139 | @test @constinferred(unitspace(V)) == W == unitspace(typeof(V)) |
| 140 | + @test @constinferred(leftunitspace(V)) == W == @constinferred(rightunitspace(V)) |
137 | 141 | @test @constinferred(zerospace(V)) == ℂ^0 == zerospace(typeof(V)) |
138 | 142 | @test @constinferred(⊕(V, zerospace(V))) == V |
139 | 143 | @test @constinferred(⊕(V, V)) == ℂ^(2d) |
|
228 | 232 | randunit = rand(collect(allunits(I))) |
229 | 233 | @test_throws ArgumentError("Sector $(randunit) appears multiple times") GradedSpace(randunit => 1, randunit => 3) |
230 | 234 |
|
| 235 | + @test isunitspace(W) |
231 | 236 | @test @constinferred(unitspace(V)) == W == unitspace(typeof(V)) |
| 237 | + if isa(UnitStyle(I), SimpleUnit) |
| 238 | + @test @constinferred(leftunitspace(V)) == W == @constinferred(rightunitspace(V)) |
| 239 | + else |
| 240 | + @test_throws ArgumentError leftunitspace(V) |
| 241 | + @test_throws ArgumentError rightunitspace(V) |
| 242 | + end |
232 | 243 | @test eval_show(W) == W |
233 | 244 | @test isa(V, VectorSpace) |
234 | 245 | @test isa(V, ElementarySpace) |
|
0 commit comments