mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 06:08:41 +01:00
The current behavior is undefined in C when converting the double to a u32, so the tests fail on some compilers. For now, I'm just removing those parts of the tests because I'm not sure what I want the behavior to be. Modulo? Truncate? Runtime error?
14 lines
412 B
Plaintext
14 lines
412 B
Plaintext
System.print(0 << 0) // expect: 0
|
|
System.print(1 << 0) // expect: 1
|
|
System.print(0 << 1) // expect: 0
|
|
System.print(1 << 1) // expect: 2
|
|
System.print(0xaaaaaaaa << 1) // expect: 1431655764
|
|
System.print(0xf0f0f0f0 << 1) // expect: 3789677024
|
|
|
|
// Max u32 value.
|
|
System.print(0xffffffff << 0) // expect: 4294967295
|
|
|
|
// TODO: Negative numbers.
|
|
// TODO: Floating-point numbers.
|
|
// TODO: Numbers that don't fit in u32.
|