Eliding length for ":"-ranges is no longer allowed.

This commit is contained in:
Christoffer Lerno
2023-08-18 22:25:51 +02:00
parent 17f69d8da8
commit d5aebb434c
6 changed files with 39 additions and 10 deletions

View File

@@ -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);
}