File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ let io = IOBuffer()
143143 @test String (take! (io)) == sprint (print, Fruit)
144144end
145145
146+ # Test printing of invalid enums
147+ @test repr (" text/plain" , reinterpret (Fruit, Int32 (11 ))) == " <invalid #11>::Fruit = 11"
148+ @test repr (" text/plain" , reinterpret (Fruit, Int32 (- 5 ))) == " <invalid #-5>::Fruit = -5"
149+
146150@enum LogLevel DEBUG INFO WARN ERROR CRITICAL
147151@test DEBUG < CRITICAL
148152
160164@test repr (" text/plain" , sevn) == " $(string (sevn)) ::UI8 = 0x07"
161165@test repr (" text/plain" , fiftn) == " $(string (fiftn)) ::UI8 = 0xf0"
162166
167+ @test repr (" text/plain" , reinterpret (UI8, 0x01 )) == " <invalid #1>::UI8 = 0x01"
168+ @test repr (" text/plain" , reinterpret (UI8, 0xff )) == " <invalid #255>::UI8 = 0xff"
169+
163170# test block form
164171@enum BritishFood begin
165172 blackpudding = 1
You can’t perform that action at this time.
0 commit comments