mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-09-24 02:38:16 +00:00
convert check to u32filter_evaluator, and use "" quotes instead of '' quotes
This commit is contained in:
parent
337d39f713
commit
691b88b9b1
|
@ -13,22 +13,24 @@
|
|||
#include "affunctions.h"
|
||||
|
||||
int main( int argc, char** argv ) {
|
||||
afp::filter_evaluator f;
|
||||
|
||||
afp::u32filter_evaluator f;
|
||||
bool result = false;
|
||||
|
||||
for(int i=0;i<=100;i++) {
|
||||
try {
|
||||
f.add_variable("foo", afp::datum::from_string("love"));
|
||||
result = f.evaluate( "specialratio('foo;') == 0.25" );
|
||||
f.add_variable(
|
||||
make_u32string("foo"),
|
||||
afp::u32datum::from_string(
|
||||
make_u32string("love")));
|
||||
result = f.evaluate(make_u32string("specialratio(\"foo;\") == 0.25"));
|
||||
} catch (afp::exception* excep) {
|
||||
printf( "Exception: %s\n", excep->what() );
|
||||
}
|
||||
}
|
||||
|
||||
if (result) {
|
||||
printf("Success!\n");
|
||||
std::cout << "success\n";
|
||||
} else {
|
||||
printf("OH NOES!\n");
|
||||
std::cout << "failed\n";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue