mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Eliding length for ":"-ranges is no longer allowed.
This commit is contained in:
@@ -18,12 +18,12 @@ fn void! test_read()
|
||||
assert(bitorder::read(&bytes, ULongBE) == 0x0102030405060708);
|
||||
assert(bitorder::read(&bytes, ULongLE) == 0x0807060504030201);
|
||||
|
||||
assert(bitorder::read(bytes[:], UShortBE) == 0x0102);
|
||||
assert(bitorder::read(bytes[:], UShortLE) == 0x0201);
|
||||
assert(bitorder::read(bytes[:], UIntBE) == 0x01020304);
|
||||
assert(bitorder::read(bytes[:], UIntLE) == 0x04030201);
|
||||
assert(bitorder::read(bytes[:], ULongBE) == 0x0102030405060708);
|
||||
assert(bitorder::read(bytes[:], ULongLE) == 0x0807060504030201);
|
||||
assert(bitorder::read(bytes[..], UShortBE) == 0x0102);
|
||||
assert(bitorder::read(bytes[..], UShortLE) == 0x0201);
|
||||
assert(bitorder::read(bytes[..], UIntBE) == 0x01020304);
|
||||
assert(bitorder::read(bytes[..], UIntLE) == 0x04030201);
|
||||
assert(bitorder::read(bytes[..], ULongBE) == 0x0102030405060708);
|
||||
assert(bitorder::read(bytes[..], ULongLE) == 0x0807060504030201);
|
||||
}
|
||||
|
||||
fn void! test_write()
|
||||
@@ -36,10 +36,10 @@ fn void! test_write()
|
||||
assert(bitorder::read(buf, UShortBE) == x1);
|
||||
|
||||
uint x2 = bitorder::read(bytes, UIntBE);
|
||||
bitorder::write(x2, buf[:], UIntBE);
|
||||
bitorder::write(x2, buf[..], UIntBE);
|
||||
assert(bitorder::read(buf, UIntBE) == x2);
|
||||
|
||||
ulong x3 = bitorder::read(bytes, ULongBE);
|
||||
bitorder::write(x3, buf[:], ULongBE);
|
||||
bitorder::write(x3, buf[..], ULongBE);
|
||||
assert(bitorder::read(buf, ULongBE) == x3);
|
||||
}
|
||||
Reference in New Issue
Block a user