1
0
Fork 0
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:
Alex Kotov 2022-05-23 23:11:36 +03:00
parent 9399cc4b79
commit f341377b32
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -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]]