mediawiki-extensions-AbuseF.../parser_native/check.cpp

27 lines
478 B
C++
Raw Normal View History

2008-08-03 00:36:27 +00:00
#include "afeval.h"
#include "affunctions.h"
int main( int argc, char** argv ) {
FilterEvaluator e;
e.reset();
bool result = false;
registerBuiltinFunctions();
for(int i=0;i<=100;i++) {
2008-08-03 00:36:27 +00:00
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");
}
}