Although some other base types like boolean objects can be expresed as strings, this is not possible with int objects. This patch adds support to express int values as strings as hex, decimal or octal values.pull/2691/head
parent
2dab7c37df
commit
30f2c4857c
2 changed files with 25 additions and 0 deletions
@ -0,0 +1,15 @@ |
||||
project('int formatting', 'c') |
||||
|
||||
values = [ |
||||
['', '74'], |
||||
['c', 'J'], |
||||
['b', '1001010'], |
||||
['d', '74'], |
||||
['o', '112'], |
||||
['x', '4a'], |
||||
['X', '4A'] |
||||
] |
||||
|
||||
foreach value: values |
||||
assert(74.to_string(value[0]) == value[1], 'conversion is broken') |
||||
endforeach |
Loading…
Reference in new issue