diff --git a/tslang/test/tester/tests/00any_to_opaque_narrow.ts b/tslang/test/tester/tests/00any_to_opaque_narrow.ts index 4dcfd6000..02fd347fc 100644 --- a/tslang/test/tester/tests/00any_to_opaque_narrow.ts +++ b/tslang/test/tester/tests/00any_to_opaque_narrow.ts @@ -30,7 +30,9 @@ function main() { assert(opaqueOf(0x1234) == 0x1234, "an s32 keeps its value"); assert(opaqueOf(0xAB) == 0xAB, "a u8"); assert(opaqueOf(0xABCD) == 0xABCD, "a u16"); - assert(opaqueOf(0x123456789A) == 0x123456789A, "a u64 is all 8 bytes"); + // a pointer holds what it has room for: all 8 bytes of a u64, or on a 32-bit target its low 4 + const wide: u64 = sizeof() == 8 ? 0x123456789A : 0x3456789A; + assert(opaqueOf(0x123456789A) == wide, "a u64 is as many bytes as a pointer holds"); print("done."); }