<commit_before>#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("plugin_file");
use Test; BEGIN { plan tests => 6 };

# ---------------------------------------------------------------------------

%patterns = (

q{ GTUBE }, 'gtube',
q{ MY_TEST_PLUGIN }, 'plugin_called',
q{ registered myTestPlugin }, 'registered',
q{ myTestPlugin eval test called }, 'test_called',

);

%anti_patterns = (

q{ SHOULD_NOT_BE_CALLED }, 'should_not_be_called'

);

tstlocalrules ("
	loadplugin myTestPlugin ../../data/testplugin.pm
	ifplugin FooPlugin
	  header SHOULD_NOT_BE_CALLED	eval:doesnt_exist()
	endif
	if plugin(myTestPlugin)
	  header MY_TEST_PLUGIN		eval:check_test_plugin()
	endif
");

ok (sarun ("-L -t < data/spam/gtube.eml", \&patterns_run_cb));
ok_all_patterns();

<commit_msg>fix bad config for plugin_file test<commit_after>#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("plugin_file");
use Test; BEGIN { plan tests => 6 };

# ---------------------------------------------------------------------------

%patterns = (

q{ GTUBE }, 'gtube',
q{ MY_TEST_PLUGIN }, 'plugin_called',
q{ registered myTestPlugin }, 'registered',
q{ myTestPlugin eval test called }, 'test_called',

);

%anti_patterns = (

q{ SHOULD_NOT_BE_CALLED }, 'should_not_be_called'

);

tstlocalrules ("
	loadplugin myTestPlugin data/testplugin.pm
	ifplugin FooPlugin
	  header SHOULD_NOT_BE_CALLED	eval:doesnt_exist()
	endif
	if plugin(myTestPlugin)
	  header MY_TEST_PLUGIN		eval:check_test_plugin()
	endif
");

ok (sarun ("-L -t < data/spam/gtube.eml", \&patterns_run_cb));
ok_all_patterns();


{'fraction_non_alphanumeric': 0.22431077694235588, 'fraction_numerical': 0.0012531328320802004, 'mean_word_length': 3.094871794871795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4391327', 'n_tokens_mistral': 598, 'n_tokens_neox': 571, 'n_words': 123}