num-vals-fix.diff 711 B

12345678910111213141516171819202122232425262728293031
  1. diff --git a/test/values.js b/test/values.js
  2. index efad789..7fa1078 100644
  3. --- a/test/values.js
  4. +++ b/test/values.js
  5. @@ -26,6 +26,12 @@ var opts = {
  6. },
  7. def2: {
  8. default: "val1"
  9. + },
  10. + "2d": {
  11. + flag: true
  12. + },
  13. + "3d": {
  14. + abbr: "3"
  15. }
  16. }
  17. @@ -80,8 +86,12 @@ exports.testDash = function(test) {
  18. };
  19. exports.testNumbers = function(test) {
  20. - var options = parser.parseArgs(['sum', '-1', '2.5', '-3.5', '4']);
  21. + var options = parser.parseArgs(['sum', '-1', '2.5', '-3.5', '4', '--2d', '-3', 'test']);
  22. test.deepEqual(options.list3, ['-1', '2.5', '-3.5', '4']);
  23. + test.strictEqual(options['2d'], true);
  24. + test.strictEqual(options['3d'], "test")
  25. test.done();
  26. };
  27. +
  28. +