<commit_before>#include "gtest/gtest.h"

#include "sdd/hom/context.hh"
#include "sdd/hom/definition.hh"
#include "sdd/manager.hh"
#include "sdd/order/order.hh"

#include "tests/configuration.hh"
#include "tests/hom/common.hh"

/*------------------------------------------------------------------------------------------------*/

template <typename C>
struct hom_id_test
  : public testing::Test
{
  typedef C configuration_type;

  sdd::manager<C> m;
  sdd::hom::context<C>& cxt;

  const sdd::SDD<C> zero;
  const sdd::SDD<C> one;

  hom_id_test()
    : m(sdd::manager<C>::init(small_conf<C>()))
    , cxt(sdd::global<C>().hom_context)
    , zero(sdd::zero<C>())
    , one(sdd::one<C>())
  {}
};

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST_CASE(hom_id_test, configurations);
#include "tests/macros.hh"

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, construction)
{
//  homomorphism h1 = id<conf>();
//  homomorphism h2 = id<conf>();
//  ASSERT_EQ(h1, h2);
}

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, evaluation)
{
//  homomorphism h = id<conf>();
//  ASSERT_EQ(one, h(order(order_builder()), one));
}

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, no_cache)
{
//  homomorphism h = id<conf>();
//  ASSERT_EQ(0u, cxt.cache().size());
//  ASSERT_EQ(one, h(cxt, order(order_builder()), one));
//  ASSERT_EQ(0u, cxt.cache().size());
}

/*------------------------------------------------------------------------------------------------*/<commit_msg>Compile identity tests.<commit_after>#include "gtest/gtest.h"

#include "sdd/hom/context.hh"
#include "sdd/hom/definition.hh"
#include "sdd/manager.hh"
#include "sdd/order/order.hh"

#include "tests/configuration.hh"
#include "tests/hom/common.hh"

/*------------------------------------------------------------------------------------------------*/

template <typename C>
struct hom_id_test
  : public testing::Test
{
  typedef C configuration_type;

  sdd::manager<C> m;
  sdd::hom::context<C>& cxt;

  const sdd::SDD<C> zero;
  const sdd::SDD<C> one;

  hom_id_test()
    : m(sdd::manager<C>::init(small_conf<C>()))
    , cxt(sdd::global<C>().hom_context)
    , zero(sdd::zero<C>())
    , one(sdd::one<C>())
  {}
};

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST_CASE(hom_id_test, configurations);

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, construction)
{
  using conf = typename TestFixture::configuration_type;
  const auto h1 = sdd::id<conf>();
  const auto h2 = sdd::id<conf>();
  ASSERT_EQ(h1, h2);
}

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, evaluation)
{
  using conf = typename TestFixture::configuration_type;
  const auto h = sdd::id<conf>();
  ASSERT_EQ(this->one, h(sdd::order<conf>(sdd::order_builder<conf>()), this->one));
}

/*------------------------------------------------------------------------------------------------*/

TYPED_TEST(hom_id_test, no_cache)
{
  using conf = typename TestFixture::configuration_type;
  const auto h = sdd::id<conf>();
  ASSERT_EQ(0u, this->cxt.cache().size());
  ASSERT_EQ(this->one, h(this->cxt, sdd::order<conf>(sdd::order_builder<conf>()), this->one));
  ASSERT_EQ(0u, this->cxt.cache().size());
}

/*------------------------------------------------------------------------------------------------*/
{'fraction_non_alphanumeric': 0.4520255863539446, 'fraction_numerical': 0.0031982942430703624, 'mean_word_length': 1.3426966292134832, 'pattern_counts': {'":': 0, '<': 35, '<?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': '496899', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1088, 'n_words': 164}