comparison test/testSbpOperators.jl @ 605:8fcf9c9afb30 refactor/toml_operator_format

Merge
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 05 Dec 2020 13:58:43 +0100
parents 6901d5375311 fbff4009c08a
children eaa8c852ddf2
comparison
equal deleted inserted replaced
604:6901d5375311 605:8fcf9c9afb30
16 @test SbpOperators.scale(s, 2) == SbpOperators.Stencil((-2,2), (2.,4.,4.,6.,8.)) 16 @test SbpOperators.scale(s, 2) == SbpOperators.Stencil((-2,2), (2.,4.,4.,6.,8.))
17 17
18 @test SbpOperators.Stencil((1,2,3,4), center=1) == SbpOperators.Stencil((0, 3),(1,2,3,4)) 18 @test SbpOperators.Stencil((1,2,3,4), center=1) == SbpOperators.Stencil((0, 3),(1,2,3,4))
19 @test SbpOperators.Stencil((1,2,3,4), center=2) == SbpOperators.Stencil((-1, 2),(1,2,3,4)) 19 @test SbpOperators.Stencil((1,2,3,4), center=2) == SbpOperators.Stencil((-1, 2),(1,2,3,4))
20 @test SbpOperators.Stencil((1,2,3,4), center=4) == SbpOperators.Stencil((-3, 0),(1,2,3,4)) 20 @test SbpOperators.Stencil((1,2,3,4), center=4) == SbpOperators.Stencil((-3, 0),(1,2,3,4))
21 end
22
23 @testset "parse_rational" begin
24 @test SbpOperators.parse_rational("1") isa Rational
25 @test SbpOperators.parse_rational("1") == 1//1
26 @test SbpOperators.parse_rational("1/2") isa Rational
27 @test SbpOperators.parse_rational("1/2") == 1//2
28 @test SbpOperators.parse_rational("37/13") isa Rational
29 @test SbpOperators.parse_rational("37/13") == 37//13
21 end 30 end
22 31
23 @testset "readoperator" begin 32 @testset "readoperator" begin
24 toml_str = """ 33 toml_str = """
25 [meta] 34 [meta]