Skip to content

Commit e3dee04

Browse files
authored
Merge pull request #58 from JuliaMath/teh/equality_tests
Add some tests for equality with promotion
2 parents bdbd2fa + 789e329 commit e3dee04

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/ufixed.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ end
197197
@test @inferred(promote(UFixed{UInt8,7}(0.197), UFixed{UInt8,4}(0.8))) ===
198198
(UFixed{UInt16,7}(0.197), UFixed{UInt16,7}(0.8))
199199

200+
@test UFixed{UInt16,16}(1) == UFixed{UInt8,8}(1)
201+
@test UFixed{UInt16,16}(0.2) == UFixed{UInt8,8}(0.2)
202+
@test UFixed{UInt16,8}(1) == UFixed{UInt8,8}(1)
203+
@test UFixed{UInt16,8}(0.2) == UFixed{UInt8,8}(0.2)
204+
@test UFixed{UInt16,16}(1) == UFixed{UInt8,6}(1)
205+
@test UFixed{UInt16,16}(0.20635) == UFixed{UInt8,6}(0.20635)
206+
@test UFixed{UInt16,4}(1) == UFixed{UInt8,6}(1)
207+
@test UFixed{UInt16,4}(0.2) == UFixed{UInt8,6}(0.2)
208+
200209
@test promote_type(UFixed8,Float32,Int) == Float32
201210
@test promote_type(UFixed8,Int,Float32) == Float32
202211
@test promote_type(Int,UFixed8,Float32) == Float32

0 commit comments

Comments
 (0)