Mercurial > repos > public > sbplib_julia
diff test/SbpOperators/readoperator_test.jl @ 830:21ab60cc0a5c operator_storage_array_of_table
Let parse_rational handle numbers and not just strings
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 12 Jan 2022 14:59:03 +0100 |
parents | ca182cbb8f49 |
children | 760c11e81fd4 |
line wrap: on
line diff
--- a/test/SbpOperators/readoperator_test.jl Wed Jan 12 13:07:43 2022 +0100 +++ b/test/SbpOperators/readoperator_test.jl Wed Jan 12 14:59:03 2022 +0100 @@ -13,6 +13,15 @@ @test SbpOperators.parse_rational("1/2") == 1//2 @test SbpOperators.parse_rational("37/13") isa Rational @test SbpOperators.parse_rational("37/13") == 37//13 + + @test SbpOperators.parse_rational(0.5) isa Rational + @test SbpOperators.parse_rational(0.5) == 1//2 + + @test SbpOperators.parse_rational("0.5") isa Rational + @test SbpOperators.parse_rational("0.5") == 1//2 + + @test SbpOperators.parse_rational(2) isa Rational + @test SbpOperators.parse_rational(2) == 2//1 end @testset "readoperator" begin