Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 832:00f6bbdcd73a operator_storage_array_of_table
Review: Include latest changes
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 12 Jan 2022 15:54:21 +0100 |
parents | 4433be383840 |
children | 313648b01504 11767fbb29f4 |
comparison
equal
deleted
inserted
replaced
813:cdc2b5ebf7cb | 832:00f6bbdcd73a |
---|---|
13 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) | 13 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) |
14 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) | 14 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) |
15 | 15 |
16 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5)) | 16 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5)) |
17 @test_throws ArgumentError CenteredStencil(1,2,3,4) | 17 @test_throws ArgumentError CenteredStencil(1,2,3,4) |
18 | |
19 # Changing the type of the weights | |
20 @test Stencil{Float64}(Stencil(1,2,3,4,5; center=2)) == Stencil(1.,2.,3.,4.,5.; center=2) | |
21 @test Stencil{Float64}(CenteredStencil(1,2,3,4,5)) == CenteredStencil(1.,2.,3.,4.,5.) | |
22 @test Stencil{Int}(Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1,2,3,4,5; center=2) | |
23 @test Stencil{Rational}(Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1//1,2//1,3//1,4//1,5//1; center=2) | |
24 | |
25 @testset "convert" begin | |
26 @test convert(Stencil{Float64}, Stencil(1,2,3,4,5; center=2)) == Stencil(1.,2.,3.,4.,5.; center=2) | |
27 @test convert(Stencil{Float64}, CenteredStencil(1,2,3,4,5)) == CenteredStencil(1.,2.,3.,4.,5.) | |
28 @test convert(Stencil{Int}, Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1,2,3,4,5; center=2) | |
29 @test convert(Stencil{Rational}, Stencil(1.,2.,3.,4.,5.; center=2)) == Stencil(1//1,2//1,3//1,4//1,5//1; center=2) | |
30 end | |
18 end | 31 end |