chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix capacity strings to be more case-insensitive
[ypp-sc-tools.db-test.git]
/
yarrg
/
web
/
check_capacitystring
diff --git
a/yarrg/web/check_capacitystring
b/yarrg/web/check_capacitystring
index a79b6f1ac06f1dffbed02820e33a819a1e31bb29..321d7540fcf31e9bf953c8574e30015de32351d4 100644
(file)
--- a/
yarrg/web/check_capacitystring
+++ b/
yarrg/web/check_capacitystring
@@
-85,7
+85,7
@@
my $parse_values= sub {
elsif (s/^( $fqtyrex ) \s* t \s+ //xo) { $def->(0, $1 * 1000.0 ); }
elsif (s/^( $fqtyrex ) \s* l \s+ //xo) { $def->(1, $1 ); }
elsif (s/^( $fqtyrex ) \s* kl \s+ //xo) { $def->(1, $1 * 1000.0 ); }
elsif (s/^( $fqtyrex ) \s* t \s+ //xo) { $def->(0, $1 * 1000.0 ); }
elsif (s/^( $fqtyrex ) \s* l \s+ //xo) { $def->(1, $1 ); }
elsif (s/^( $fqtyrex ) \s* kl \s+ //xo) { $def->(1, $1 * 1000.0 ); }
- elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //xo) {
+ elsif (s/^( $iqtyrex ) \s* ([a-z ]+) \s+ //
i
xo) {
my ($qty,$spec) = ($1,$2);
$debugf->("VALUE COMMOD $qty '$spec'");
expected_error("Capacity specification must start with".
my ($qty,$spec) = ($1,$2);
$debugf->("VALUE COMMOD $qty '$spec'");
expected_error("Capacity specification must start with".
@@
-129,7
+129,7
@@
my $parse_term= sub {
$_ *= $pct / 100.0;
}
push @canon, sprintf "%g%%", $pct;
$_ *= $pct / 100.0;
}
push @canon, sprintf "%g%%", $pct;
- } elsif (!m/[^a-z]/) {
+ } elsif (!m/[^a-z]/
i
) {
$debugf->("TERM NAME");
expected_error("Name (should be unit or commodity) \`$_'".
" without preceding quantity")
$debugf->("TERM NAME");
expected_error("Name (should be unit or commodity) \`$_'".
" without preceding quantity")
@@
-140,7
+140,7
@@
my $parse_term= sub {
dbw_lookup_string($_,$sth,1,1,2,
"Ship name `$_' not understood.",
"Too many matching ship types.",
dbw_lookup_string($_,$sth,1,1,2,
"Ship name `$_' not understood.",
"Too many matching ship types.",
- sub { "Ambiguous - could be $_[
0
]" });
+ sub { "Ambiguous - could be $_[
1
]" });
expected_error($emsg) if defined $emsg;
$debugf->("TERM NAME SHIP '$ship' @smv");
$show_answer= 1;
expected_error($emsg) if defined $emsg;
$debugf->("TERM NAME SHIP '$ship' @smv");
$show_answer= 1;