summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-11-06 12:48:41 -0800
committerMark Wells <mark@freeside.biz>2012-11-06 12:49:11 -0800
commit468c9e660eb0edb2033f0f8dbb4458f20280082c (patch)
tree9a87abfbfad9c820598c3a8d773f35c421c2bb38 /bin
parent2b2aa5664742a134da11862a7cedb37d25524423 (diff)
improved address standardization, #13763
Diffstat (limited to 'bin')
-rwxr-xr-xbin/generate-table-module2
-rwxr-xr-xbin/usps-webtools-test-script38
2 files changed, 39 insertions, 1 deletions
diff --git a/bin/generate-table-module b/bin/generate-table-module
index e7fc99258..b536360c5 100755
--- a/bin/generate-table-module
+++ b/bin/generate-table-module
@@ -95,7 +95,7 @@ close TEST;
# add them to MANIFEST
###
-system('cvs edit FS/MANIFEST');
+#system('cvs edit FS/MANIFEST');
open(MANIFEST,">>FS/MANIFEST") or die $!;
print MANIFEST "FS/$table.pm\n",
diff --git a/bin/usps-webtools-test-script b/bin/usps-webtools-test-script
new file mode 100755
index 000000000..414ae4cad
--- /dev/null
+++ b/bin/usps-webtools-test-script
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use FS::Misc::Geo 'standardize';
+use Data::Dumper; $Data::Dumper::Terse = 1;
+my @tests = (
+ {
+ address1 => '6406 Ivy Lane',
+ address2 => '',
+ city => 'Greenbelt',
+ state => 'MD',
+ zip => '',
+ },
+ {
+ address1 => '8 Wildwood Drive',
+ address2 => '',
+ city => 'Old Lyme',
+ state => 'CT',
+ zip => '06371',
+ },
+);
+
+my ($userid, $password) = @ARGV;
+
+my %opt = (
+ userid => $userid,
+ password=> $password,
+ test => 1,
+);
+my $i = 1;
+foreach (@tests) {
+ print "Test $i\n";
+ my $result = eval { standardize($_, %opt) };
+ print "ERROR: $@\n\n" if $@;
+ print Dumper($result);
+ $i++;
+}
+
+1;