<commit_before>// boost
#include <boost/test/unit_test.hpp>

#include <ports/dev.hpp>
#include <core/connection.hpp>

BOOST_AUTO_TEST_CASE( fetcher_ )
{
	auto give_one = [](){return 1;};
	fetcher<int> sink;
	give_one >> sink;
	BOOST_CHECK(sink.get() == 1);
}

BOOST_AUTO_TEST_CASE( state_ )
{
	auto increment = [](int i) -> int {return i+1;};
	state<int> source {1};
	fetcher<int> sink;
	source >> increment >> sink;
	BOOST_CHECK(sink.get() == 2);
}


<commit_msg>Failing unit tests for state class. state.set does not propagate to copied<commit_after>// boost
#include <boost/test/unit_test.hpp>

#include <ports/dev.hpp>
#include <core/connection.hpp>

BOOST_AUTO_TEST_CASE( fetcher_ )
{
	auto give_one = [](){return 1;};
	fetcher<int> sink;
	give_one >> sink;
	BOOST_CHECK(sink.get() == 1);
}

BOOST_AUTO_TEST_CASE( state_fetcher_direct_connection )
{
	state<int> source {1};
	fetcher<int> sink;
	source >> sink;
	BOOST_CHECK(sink.get() == 1);
	source.set(2);
	BOOST_CHECK(sink.get() == 2);
}

BOOST_AUTO_TEST_CASE( state_multiple_fetchers_and_assignment )
{
	auto increment = [](int i) -> int {return i+1;};
	state<int> source {1};
	fetcher<int> sink1;
	fetcher<int> sink2;
	source >> increment >> increment >> sink1;
	source >> increment >> increment >> sink2;
	BOOST_CHECK(sink1.get() == 3);
	BOOST_CHECK(sink2.get() == 3);
	source.set(5);
	BOOST_CHECK(sink1.get() == 7);
	BOOST_CHECK(sink2.get() == 7);
}





{'fraction_non_alphanumeric': 0.17443502824858756, 'fraction_numerical': 0.018361581920903956, 'mean_word_length': 5.029787234042553, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 42, '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': '5968117', 'n_tokens_mistral': 592, 'n_tokens_neox': 565, 'n_words': 117}