Closed oscbyspro closed 1 month ago
Something silly is going on in the #expect
macro:
@Test func what() {
#expect(U32(256 * 256) == 000065536 ) // true
#expect(U32(256 * 256) == U32(000065536)) // true
#expect(U32(256 * 256) == 256 * 256 ) // Expectation failed: (U32(256 * 256) → 65536) == (256 * 256 → 65536)
#expect(U32(256 * 256) == U32(256 * 256)) // true
print( U32(256 * 256) == 000065536 ) // true
print( U32(256 * 256) == U32(000065536)) // true
print( U32(256 * 256) == 256 * 256 ) // true
print( U32(256 * 256) == U32(256 * 256)) // true
}
Edit: It looks like the multiplication maps 256 * 256
to AnyHashable
in the #expect
case.
Testing
is in the toolchain now, so I don't have to build it myself.I'll adopt it incrementally, since that's the direction Swift is headed.