| 1 | const zzz_byte_a = u8(`A`) |
| 2 | |
| 3 | const zzz_u16_a = u16(999) + 5 |
| 4 | |
| 5 | const zzza = u64(123) |
| 6 | |
| 7 | const zzzb = 5 + zzzc |
| 8 | |
| 9 | const zzzc = 6 + zzza |
| 10 | |
| 11 | const zzzx = zzza - 124 |
| 12 | |
| 13 | const zzz_zz = i64(-1) |
| 14 | |
| 15 | struct Abc { |
| 16 | x int |
| 17 | } |
| 18 | |
| 19 | const zzz_struct = Abc{123} |
| 20 | |
| 21 | const zzzs = 'xyz' + 'abc' |
| 22 | |
| 23 | fn test_number_consts() { |
| 24 | assert zzz_byte_a.hex_full() == '41' |
| 25 | assert zzz_u16_a.hex_full() == '03ec' |
| 26 | assert zzza.hex_full() == '000000000000007b' |
| 27 | assert zzzb.hex_full() == '0000000000000086' |
| 28 | assert zzzc.hex_full() == '0000000000000081' |
| 29 | // assert zzzx.hex_full() == '00000000ffffffff' // TODO: see why |
| 30 | assert zzz_zz.hex_full() == 'ffffffffffffffff' |
| 31 | } |
| 32 | |
| 33 | fn test_struct_consts() { |
| 34 | assert zzz_struct.str().contains('x: 123') |
| 35 | } |
| 36 | |
| 37 | fn test_string_consts() { |
| 38 | assert zzzs == 'xyzabc' |
| 39 | } |
| 40 | |