| 1 | import strconv |
| 2 | |
| 3 | struct VariadicVoidptrValue { |
| 4 | mut: |
| 5 | x u8 |
| 6 | } |
| 7 | |
| 8 | fn test_variadic_voidptr_rvalues_are_boxed_with_promotions() { |
| 9 | mut value := VariadicVoidptrValue{ |
| 10 | x: 1 |
| 11 | } |
| 12 | assert unsafe { strconv.v_sprintf('x=%02d', value.x) } == 'x=01' |
| 13 | assert unsafe { strconv.v_sprintf('x=%02d', int(value.x)) } == 'x=01' |
| 14 | assert unsafe { strconv.v_sprintf('%s %.1f', 'abc', f32(1.5)) } == 'abc 1.5' |
| 15 | } |
| 16 |