Mercurial > repos > public > sbplib_julia
comparison test/LazyTensors/tuple_manipulation_test.jl @ 1219:7ee258e5289e
Merge feature/dissipation_operators
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 08 Feb 2023 10:29:06 +0100 |
| parents | 0905cec43d2e |
| children | 5bfb182e24dc |
comparison
equal
deleted
inserted
replaced
| 1202:d13b73e9f65e | 1219:7ee258e5289e |
|---|---|
| 58 @test LazyTensors.flatten_tuple((1,2,3,4,5,6)) == (1,2,3,4,5,6) | 58 @test LazyTensors.flatten_tuple((1,2,3,4,5,6)) == (1,2,3,4,5,6) |
| 59 @test LazyTensors.flatten_tuple((1,2,(3,4),5,6)) == (1,2,3,4,5,6) | 59 @test LazyTensors.flatten_tuple((1,2,(3,4),5,6)) == (1,2,3,4,5,6) |
| 60 @test LazyTensors.flatten_tuple((1,2,(3,(4,5)),6)) == (1,2,3,4,5,6) | 60 @test LazyTensors.flatten_tuple((1,2,(3,(4,5)),6)) == (1,2,3,4,5,6) |
| 61 @test LazyTensors.flatten_tuple(((1,2),(3,4),(5,),6)) == (1,2,3,4,5,6) | 61 @test LazyTensors.flatten_tuple(((1,2),(3,4),(5,),6)) == (1,2,3,4,5,6) |
| 62 end | 62 end |
| 63 | |
| 64 @testset "left_pad_tuple" begin | |
| 65 @test LazyTensors.left_pad_tuple((1,2), 0, 2) == (1,2) | |
| 66 @test LazyTensors.left_pad_tuple((1,2), 0, 3) == (0,1,2) | |
| 67 @test LazyTensors.left_pad_tuple((3,2), 1, 6) == (1,1,1,1,3,2) | |
| 68 | |
| 69 @test_throws DomainError(0, "Can't pad tuple of length 2 to 0 elements") LazyTensors.left_pad_tuple((1,2), 0, 0) == (1,2) | |
| 70 end | |
| 71 | |
| 72 @testset "right_pad_tuple" begin | |
| 73 @test LazyTensors.right_pad_tuple((1,2), 0, 2) == (1,2) | |
| 74 @test LazyTensors.right_pad_tuple((1,2), 0, 3) == (1,2,0) | |
| 75 @test LazyTensors.right_pad_tuple((3,2), 1, 6) == (3,2,1,1,1,1) | |
| 76 | |
| 77 @test_throws DomainError(0, "Can't pad tuple of length 2 to 0 elements") LazyTensors.right_pad_tuple((1,2), 0, 0) == (1,2) | |
| 78 end |
