Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adjust error message for directives/arguements mismatch in nqp tests
  • Loading branch information
usev6 committed Jan 24, 2015
1 parent 878c6ae commit 6fa84cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions t/hll/06-sprintf.t
Expand Up @@ -32,15 +32,15 @@ is(nqp::sprintf('Peter %s', ['Bishop']), 'Peter Bishop', 'one %s directive' );
is(nqp::sprintf('%s %s', ['William', 'Bell']), 'William Bell', 'two %s directives' );

dies_ok({ nqp::sprintf('%s %s', ['Dr.', 'William', 'Bell']) }, 'arguments > directives' );
is($die_message, 'Too few directives: found 2, fewer than the 3 arguments after the format string',
is($die_message, 'Directives specify 2 arguments, but 3 arguments were supplied',
'arguments > directives error message' );

dies_ok({ nqp::sprintf('%s %s %s', ['Olivia', 'Dunham']) }, 'directives > arguments' );
is($die_message, 'Too many directives: found 3, but only 2 arguments after the format string',
is($die_message, 'Directives specify 3 arguments, but 2 arguments were supplied',
'directives > arguments error message' );

dies_ok({ nqp::sprintf('%s %s', []) }, 'directives > 0 arguments' );
is($die_message, 'Too many directives: found 2, but no arguments after the format string',
is($die_message, 'Directives specify 2 arguments, but no argument was supplied',
'directives > 0 arguments error message' );

is(nqp::sprintf('%% %% %%', []), '% % %', '%% escape' );
Expand Down

0 comments on commit 6fa84cc

Please sign in to comment.