Enhancement

- When formating real numbers that are between 0 and 1, the width controls the
  number of characters that are shown (with width "4", "0.01234" is shown as
  "0.01").
This commit is contained in:
Louis-Claude Canon 2012-07-27 00:30:39 +02:00 committed by Paul Beckingham
parent afcbaa20a9
commit 0ac6578899
2 changed files with 25 additions and 1 deletions

View file

@ -28,7 +28,7 @@
use strict;
use warnings;
use Test::More tests => 48;
use Test::More tests => 49;
# Create the rc file.
if (open my $fh, '>', 'urgency.rc')
@ -310,6 +310,11 @@ qx {../src/task rc:urgency.rc add 12b scheduled:yesterday 2>&1};
$output = qx{../src/task rc:urgency.rc 45 _urgency 2>&1};
like ($output, qr/urgency 5$/ms, 'scheduled past = 5');
# urgency values between 0 and 1
qx {../src/task rc:urgency.rc add 13 pri:H 2>&1};
$output = qx{../src/task rc:urgency.rc rc.urgency.priority.coefficient:0.01234 46 info 2>&1};
like ($output, qr/Urgency 0.01$/ms, 'near-zero urgency is truncated');
# Cleanup.
unlink qw(pending.data completed.data undo.data backlog.data synch.key urgency.rc);
ok (! -r 'pending.data' &&