Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
46
lib/vscode/extensions/perl/test/colorize-fixtures/test.pl
Normal file
46
lib/vscode/extensions/perl/test/colorize-fixtures/test.pl
Normal file
@ -0,0 +1,46 @@
|
||||
use strict;
|
||||
|
||||
my $badfound = 0;
|
||||
sub check_line {
|
||||
my($fn, $line) = @_;
|
||||
|
||||
# Check for that =.
|
||||
if($line =~ /^\s*if\s*\(.*[^!<>=]=([^=].*\)|\))/) {
|
||||
if(!$badfound) {
|
||||
print("The following suspicious lines were found:\n");
|
||||
$badfound = 1;
|
||||
}
|
||||
print "$fn:$.: $line\n";
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# This function opens and reads one file, and calls
|
||||
# check_line to analyze each line. Call it with the
|
||||
# file name.
|
||||
#
|
||||
sub check_file {
|
||||
my($fn) = @_;
|
||||
|
||||
if(!open(IN, $fn)) {
|
||||
print "Cannot read $fn.\n";
|
||||
return;
|
||||
}
|
||||
|
||||
my($line);
|
||||
while($line = <IN>)
|
||||
{
|
||||
chomp $line;
|
||||
check_line($fn,$line);
|
||||
}
|
||||
|
||||
close IN;
|
||||
}
|
||||
|
||||
#
|
||||
# Go through the argument list and check each file
|
||||
#
|
||||
while(my $fn = shift @ARGV) {
|
||||
check_file($fn);
|
||||
}
|
||||
if(!$badfound) { print "No suspicious lines were found.\n"; }
|
31
lib/vscode/extensions/perl/test/colorize-fixtures/test2.pl
Normal file
31
lib/vscode/extensions/perl/test/colorize-fixtures/test2.pl
Normal file
@ -0,0 +1,31 @@
|
||||
die("[$sheet->{label}] Unexpected sheet format.") unless (
|
||||
$sheet->{"$date_col$row"} =~ /CALL_DATE/i &&
|
||||
$sheet->{"$pixel_cols[4]$row"} =~ /Home_Bind_Count/i
|
||||
);
|
||||
|
||||
$row++;
|
||||
while ($row < $sheet->{maxrow}) {
|
||||
$row++;
|
||||
$total_lines++;
|
||||
|
||||
my $date = $sheet->{"$date_col$row"};
|
||||
next unless $date;
|
||||
(warning "Unexpected date format: '$date'"), next unless ($date =~ /^2\d\d\d-\d\d-\d\d$/);
|
||||
|
||||
my $phone = trim($sheet->{"$phone_col$row"});
|
||||
(warning "Unexpected phone format: '$phone'."), next unless ($phone =~ /^\d{10}$/);
|
||||
|
||||
info $phone;
|
||||
next if ($date gt $date_to || $date lt $date_from);
|
||||
|
||||
my @pixels = (0) x 5;
|
||||
for (1..4) {
|
||||
$pixels[$_] = trim($sheet->{"$pixel_cols[4]$row"});
|
||||
(warning "Pixel $_ is not a number in the row # $row."), next unless looks_like_number($pixels[$_]);
|
||||
};
|
||||
|
||||
for (1..4) {
|
||||
add_phone_activity($date, $phone, "pixel-$_", $pixels[$_]) if $pixels[$_];
|
||||
};
|
||||
$parsed_lines++;
|
||||
};
|
3313
lib/vscode/extensions/perl/test/colorize-results/test2_pl.json
Normal file
3313
lib/vscode/extensions/perl/test/colorize-results/test2_pl.json
Normal file
File diff suppressed because it is too large
Load Diff
2312
lib/vscode/extensions/perl/test/colorize-results/test_pl.json
Normal file
2312
lib/vscode/extensions/perl/test/colorize-results/test_pl.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user