Open ashwalk33r opened 4 years ago
Please provide unit tests
To be honest I do not know sprintf - what types of input are good to include in test? Can you guide me a little?
Basicly I change how ".precision" is interpreted - from digit(s) to digit(s) or 0 - what would be enough coverage in unit tests for that?
Idea 1 take existing precision tests (there is few) and change their precision to nothing and compare with .0
Idea 2 http://www.cplusplus.com/reference/cstdio/printf/ cover every case described in ".precision | description" section
Idea 3 Any place already containing tests that you know about (can be in diff language) that we can inspire from?
Best tests I could think of added.
Bump
bump?
bump?
Can't remember why but I think this PR fixed some issue on another repo. Test still not good enough? It's been months.
alexei doesnt care apperantly
Can't remember why but I think this PR fixed some issue on another repo. Test still not good enough? It's been months.
The other repo/issue is https://github.com/fengari-lua/fengari/issues/147 (still blocked on this, 5 years later). Just ran into this one myself. XD
fix https://github.com/alexei/sprintf.js/issues/181
change regex matching precision in order to reflect C documentation: "if the period is specified without an explicit value for precision, 0 is assumed"