mirror of
https://github.com/tailix/libkernaux.git
synced 2024-11-13 11:04:27 -05:00
Ruby: add specs for method KernAux.sprintf
This commit is contained in:
parent
9399cc4b79
commit
f341377b32
1 changed files with 21 additions and 0 deletions
|
@ -529,3 +529,24 @@
|
|||
args: [['%20.5X', 305_441_741]]
|
||||
- result: ' 00EDCB5433'
|
||||
args: [['%20.10X', 3_989_525_555]]
|
||||
|
||||
# padding neg numbers
|
||||
|
||||
# space padding
|
||||
- result: '-5'
|
||||
args: [['% 1d', -5]]
|
||||
- result: '-5'
|
||||
args: [['% 2d', -5]]
|
||||
- result: ' -5'
|
||||
args: [['% 3d', -5]]
|
||||
- result: ' -5'
|
||||
args: [['% 4d', -5]]
|
||||
# zero padding
|
||||
- result: '-5'
|
||||
args: [['%01d', -5]]
|
||||
- result: '-5'
|
||||
args: [['%02d', -5]]
|
||||
- result: '-05'
|
||||
args: [['%03d', -5]]
|
||||
- result: '-005'
|
||||
args: [['%04d', -5]]
|
||||
|
|
Loading…
Reference in a new issue