<commit_before>#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("spamc_c");
use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 2) };

exit if $SKIP_SPAMD_TESTS;

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

%patterns = (
);

start_spamd("-L");
ok (!spamcrun ("-E < data/spam/001", \&patterns_run_cb));
stop_spamd();
start_spamd("-L");
ok (spamcrun ("-E < data/nice/001", \&patterns_run_cb));
stop_spamd();

<commit_msg>fix spamc_E test -- spamd-related tests should only stop spamd once, and spamd will get stopped if spamc returns an error, so put the failure one at the end.<commit_after>#!/usr/bin/perl

use lib '.'; use lib 't';
use SATest; sa_t_init("spamc_E");
use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 2) };

exit if $SKIP_SPAMD_TESTS;

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

%patterns = (
);

start_spamd("-L");
ok (spamcrun ("-E < data/nice/001", \&patterns_run_cb));
ok (!spamcrun ("-E < data/spam/001", \&patterns_run_cb));
stop_spamd();


{'fraction_non_alphanumeric': 0.30254476908576816, 'fraction_numerical': 0.015080113100848256, 'mean_word_length': 2.3607594936708862, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6107147', 'n_tokens_mistral': 408, 'n_tokens_neox': 387, 'n_words': 95}