<commit_before>#include "vast/error.hpp"
#include "vast/format/bro.hpp"
#include "vast/system/sink.hpp"

#define SUITE system
#include "test.hpp"
#include "data.hpp"
#include "fixtures/actor_system_and_events.hpp"

using namespace vast;
using namespace vast::system;

FIXTURE_SCOPE(sink_tests, fixtures::actor_system_and_events)

TEST(Bro sink) {
  // Now write those events.
  MESSAGE("constructing a sink");
  format::bro::writer writer{directory / "bro"};
  auto snk = self->spawn(sink<format::bro::writer>, std::move(writer));
  MESSAGE("sending events");
  self->send(snk, bro_conn_log);
  MESSAGE("shutting down");
  self->send_exit(snk, caf::exit_reason::user_shutdown);
  self->wait_for(snk);
}

FIXTURE_SCOPE_END()<commit_msg>Cleanup sink unit test<commit_after>#include "vast/error.hpp"
#include "vast/format/bro.hpp"
#include "vast/system/sink.hpp"

#define SUITE system
#include "test.hpp"
#include "data.hpp"
#include "fixtures/actor_system_and_events.hpp"

using namespace vast;
using namespace vast::system;

FIXTURE_SCOPE(sink_tests, fixtures::actor_system_and_events)

TEST(Bro sink) {
  MESSAGE("constructing a sink");
  format::bro::writer writer{directory};
  auto snk = self->spawn(sink<format::bro::writer>, std::move(writer));
  MESSAGE("sending events");
  self->send(snk, bro_conn_log);
  MESSAGE("shutting down");
  self->send_exit(snk, caf::exit_reason::user_shutdown);
  self->wait_for(snk);
  CHECK(exists(directory / "bro::conn.log"));
}

FIXTURE_SCOPE_END()
{'fraction_non_alphanumeric': 0.15793010752688172, 'fraction_numerical': 0.0, 'mean_word_length': 6.836842105263158, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6484216', 'n_tokens_mistral': 558, 'n_tokens_neox': 530, 'n_words': 97}