Codebase list libgetopt-long-descriptive-perl / ee8a964
Add (failing) tests for documentation of types Arthur Axel 'fREW' Schmidt authored 8 years ago Ricardo Signes committed 7 years ago
1 changed file(s) with 19 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11 use strict;
22 use warnings;
33
4 use Test::More tests => 46;
4 use Test::More tests => 58;
55
66 use_ok("Getopt::Long::Descriptive");
77
330330 is($@, '', "no error in eval");
331331 }
332332
333 {
334 my $p = \&Getopt::Long::Descriptive::Usage::_parse_assignment;
335
336 is ($p->('=s'), ' STR', 'string');
337 is ($p->('=i'), ' INT', 'int (i)');
338 is ($p->('=o'), ' INT', 'int (o)');
339 is ($p->('=f'), ' NUM', 'float');
340
341 is ($p->('=s@'), ' STR...', 'strings');
342 is ($p->('=i@'), ' INT...', 'ints (i)');
343 is ($p->('=o@'), ' INT...', 'ints (o)');
344 is ($p->('=f@'), ' NUM...', 'floats');
345
346 is ($p->('=s%'), ' KEY=STR...', 'string maps');
347 is ($p->('=i%'), ' KEY=INT...', 'int maps (i)');
348 is ($p->('=o%'), ' KEY=INT...', 'int maps (o)');
349 is ($p->('=f%'), ' KEY=NUM...', 'float maps');
350 }