| 1 | @[translated] |
| 2 | module main |
| 3 | |
| 4 | fn test_NotSnakeCaseFunction() { |
| 5 | assert true |
| 6 | assert 8 == 2 * 4 |
| 7 | assert 2 * 3 == 6 |
| 8 | } |
| 9 | |
| 10 | const ssf = [1, 2, 3]! |
| 11 | |
| 12 | fn test_const_name_without_main_prefix() { |
| 13 | assert ssf[0] == 1 |
| 14 | } |
| 15 | |
| 16 | struct ASMOperand { |
| 17 | constraint [2]i8 |
| 18 | } |
| 19 | |
| 20 | fn test_pointer_assign_without_memcpy() { |
| 21 | op := ASMOperand{ |
| 22 | constraint: [i8(5), 4]! |
| 23 | } |
| 24 | str := &i8(0) |
| 25 | str = op.constraint |
| 26 | assert !isnil(str) |
| 27 | |
| 28 | ops := [3]ASMOperand{} |
| 29 | pop := &ASMOperand(0) |
| 30 | pop = ops |
| 31 | assert pop[1].constraint[0] == 0 |
| 32 | } |
| 33 | |
| 34 | struct StubIndex { |
| 35 | pub mut: |
| 36 | data [5][5]map[string]string |
| 37 | } |
| 38 | |
| 39 | fn test_pointer_assign_with_memcpy() { |
| 40 | mut s := StubIndex{} |
| 41 | s.data[1] = [5]map[string]string{} |
| 42 | |
| 43 | mut data := s.data[1] |
| 44 | data[0]['abc'] = '123' |
| 45 | k := data[0]['abc'] |
| 46 | assert k == '123' |
| 47 | } |
| 48 | |