Skip to content

Commit 0230738

Browse files
schwernLeont
authored andcommitted
Confidence levels are a number from 0 to 1, not strings.
String comparision happened to work because the numbers are always less than 1. You can't mess up 0.1 with 0.09 like you can 10 vs 9. It's still not good to tempt fate.
1 parent 6be1f64 commit 0230738

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/TAP/Parser/IteratorFactory.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ sub detect_source {
265265
# if multiple handlers can handle it, choose the most confident one
266266
my @handlers = (
267267
map {$_}
268-
sort { $handlers{$a} cmp $handlers{$b} }
268+
sort { $handlers{$a} <=> $handlers{$b} }
269269
keys %handlers
270270
);
271271

t/lib/MyFileSourceHandler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sub can_handle {
2020
my $class = shift;
2121
$class->SUPER::can_handle(@_);
2222
$CAN_HANDLE++;
23-
return $class;
23+
return 1;
2424
}
2525

2626
sub make_iterator {

0 commit comments

Comments
 (0)