diff test/SbpOperators/readoperator_test.jl @ 809:219c9661e700 operator_storage_array_of_table

Always parse as rationals
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 18 Sep 2021 23:40:25 +0200
parents 0158c3fd521c
children ca182cbb8f49
line wrap: on
line diff
--- a/test/SbpOperators/readoperator_test.jl	Sat Sep 18 23:31:50 2021 +0200
+++ b/test/SbpOperators/readoperator_test.jl	Sat Sep 18 23:40:25 2021 +0200
@@ -93,9 +93,9 @@
             s8 = {s = ["1", "-2", "1", "0", "0", "0"], c = [2,2]}
         """
 
-        @test parse_stencil(TOML.parse(toml)["s1"]) == CenteredStencil(-1/12, 4/3, -5/2, 4/3, -1/12)
-        @test parse_stencil(TOML.parse(toml)["s2"]) == Stencil(2., -5., 4., -1., 0., 0.; center=1)
-        @test parse_stencil(TOML.parse(toml)["s3"]) == Stencil(1., -2., 1., 0., 0., 0.; center=2)
+        @test parse_stencil(TOML.parse(toml)["s1"]) == CenteredStencil(-1//12, 4//3, -5//2, 4//3, -1//12)
+        @test parse_stencil(TOML.parse(toml)["s2"]) == Stencil(2//1, -5//1, 4//1, -1//1, 0//1, 0//1; center=1)
+        @test parse_stencil(TOML.parse(toml)["s3"]) == Stencil(1//1, -2//1, 1//1, 0//1, 0//1, 0//1; center=2)
 
         @test_throws ArgumentError parse_stencil(TOML.parse(toml)["s4"])
         @test_throws ArgumentError parse_stencil(TOML.parse(toml)["s5"])
@@ -106,10 +106,10 @@
         stencil_set = get_stencil_set(parsed_toml; order = 4, test = 1)
 
         @test parse_stencil.(stencil_set["D2"]["closure_stencils"]) == [
-            Stencil(    2.,    -5.,      4.,       -1.,     0.,     0.; center=1),
-            Stencil(    1.,    -2.,      1.,        0.,     0.,     0.; center=2),
-            Stencil(-4/43, 59/43, -110/43,   59/43, -4/43,     0.; center=3),
-            Stencil(-1/49,     0.,   59/49, -118/49, 64/49, -4/49; center=4),
+            Stencil(  2//1,  -5//1,     4//1,    -1//1,   0//1,   0//1; center=1),
+            Stencil(  1//1,  -2//1,     1//1,     0//1,   0//1,   0//1; center=2),
+            Stencil(-4//43, 59//43, -110//43,   59//43, -4//43,   0//1; center=3),
+            Stencil(-1//49,   0//1,   59//49, -118//49, 64//49, -4//49; center=4),
         ]
     end
 end