You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by gb...@apache.org on 2022/05/03 12:39:54 UTC

svn commit: r1900507 - /spamassassin/trunk/t/decodeshorturl.t

Author: gbechis
Date: Tue May  3 12:39:54 2022
New Revision: 1900507

URL: http://svn.apache.org/viewvc?rev=1900507&view=rev
Log:
test autocleanup

Modified:
    spamassassin/trunk/t/decodeshorturl.t

Modified: spamassassin/trunk/t/decodeshorturl.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/decodeshorturl.t?rev=1900507&r1=1900506&r2=1900507&view=diff
==============================================================================
--- spamassassin/trunk/t/decodeshorturl.t (original)
+++ spamassassin/trunk/t/decodeshorturl.t Tue May  3 12:39:54 2022
@@ -12,7 +12,7 @@ use constant SQLITE => (HAS_DBI && HAS_D
 
 plan skip_all => "Net tests disabled"                unless conf_bool('run_net_tests');
 my $tests = 3;
-$tests += 2 if (SQLITE);
+$tests += 4 if (SQLITE);
 plan tests => $tests;
 
 tstpre ("
@@ -83,4 +83,13 @@ clear_pattern_counters();
 my $dbh = DBI->connect("dbi:SQLite:dbname=$workdir/DecodeShortURLs.db","","");
 my @row = $dbh->selectrow_array("SELECT decoded_url FROM short_url_cache WHERE short_url = 'http://bit.ly/30yH6WK'");
 is($row[0], 'http://spamassassin.apache.org/');
+
+# Check another email to cleanup old entries from database
+sarun ("-t < data/spam/decodeshorturl/base2.eml", \&patterns_run_cb);
+ok_all_patterns();
+clear_pattern_counters();
+
+my $dbh = DBI->connect("dbi:SQLite:dbname=$workdir/DecodeShortURLs.db","","");
+my @row = $dbh->selectrow_array("SELECT decoded_url FROM short_url_cache WHERE short_url = 'http://bit.ly/30yH6WK'");
+isnt($row[0], 'https://spamassassin.apache.org/');
 }