sprintf.js icon indicating copy to clipboard operation
sprintf.js copied to clipboard

#181 %.f fails with unexpected placeholder

Open ashwalk33r opened this issue 5 years ago • 8 comments

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"

ashwalk33r avatar Apr 02 '20 21:04 ashwalk33r

Please provide unit tests

alexei avatar Apr 03 '20 08:04 alexei

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?

ashwalk33r avatar Apr 03 '20 15:04 ashwalk33r

Best tests I could think of added.

ashwalk33r avatar Apr 04 '20 12:04 ashwalk33r

Bump

ricksterhd123 avatar Jun 01 '20 22:06 ricksterhd123

bump?

ashwalk33r avatar Oct 25 '20 09:10 ashwalk33r

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.

ricksterhd123 avatar Nov 02 '20 09:11 ricksterhd123

alexei doesnt care apperantly

ashwalk33r avatar Jun 10 '22 17:06 ashwalk33r