Skip to content

Commit d1da1db

Browse files
Add test for promotion between large FD and small Rational
1 parent 460eb8f commit d1da1db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/runtests.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ end
266266
@test 1 + FD2(0.1) === FD2(1.1)
267267
@test FD2(0.1) + FD4(0.0001) === FD4(0.1001)
268268
@test WFD2(0.1) + FD4(0.0001) === WFD4(0.1001)
269+
270+
# promotion with Rational
271+
# see https://github.com/JuliaMath/FixedPointDecimals.jl/issues/73
272+
r = Rational{Int8}(1//1)
273+
fd = FixedDecimal{Int128,4}(2.5806)
274+
@test (r + fd) isa Rational{Int128}
269275
end
270276

271277
@testset "float" begin

0 commit comments

Comments
 (0)