mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-25 14:35:54 +00:00
30 lines
541 B
C++
Executable file
30 lines
541 B
C++
Executable file
#include "afeval.h"
|
|
#include "affunctions.h"
|
|
|
|
int main( int argc, char** argv ) {
|
|
FilterEvaluator e;
|
|
|
|
e.reset();
|
|
bool result = false;
|
|
|
|
cout << AFPData((string)"0.25").toString() << endl;
|
|
exit(0);
|
|
|
|
registerBuiltinFunctions();
|
|
|
|
for(int i=0;i<=1;i++) {
|
|
try {
|
|
e.setVar( "foo", AFPData(string("love")) );
|
|
result = e.evaluateFilter( "specialratio('foo;') == 0.25" );
|
|
} catch (AFPException* excep) {
|
|
printf( "Exception: %s\n", excep->what() );
|
|
}
|
|
}
|
|
|
|
if (result) {
|
|
printf("Success!\n");
|
|
} else {
|
|
printf("OH NOES!\n");
|
|
}
|
|
}
|