<commit_before>#include "utility/to_string.hpp"

#include "domain/mesh/factory.hpp"
#include "instrumentation/converter/factory.hpp"
#include "instrumentation/outstream/factory.hpp"
#include "solver/group/factory.hpp"
#include "solver/linear/factory.hpp"
#include "test_helpers/gmock_wrapper.h"
#include "test_helpers/test_helper_functions.h"

namespace  {

namespace utility = bart::utility;
namespace converter = bart::instrumentation::converter;
namespace test_helpers = bart::test_helpers;

using MeshName = bart::domain::mesh::MeshName;
using ConverterName = converter::ConverterName;
using OutstreamName = bart::instrumentation::outstream::OutstreamName;
using GroupSolverName = bart::solver::group::GroupSolverName;
using LinearSolverName = bart::solver::linear::LinearSolverName;

template <typename T>
class UtilityToStringTest : public ::testing::Test {
 public:
  [[nodiscard]] auto GetValue() const -> T;
};

using TestTypes = ::testing::Types<int, double, ConverterName, MeshName, OutstreamName, GroupSolverName, LinearSolverName>;
TYPED_TEST_SUITE(UtilityToStringTest, TestTypes);

template <>
auto UtilityToStringTest<int>::GetValue() const -> int { return test_helpers::RandomInt(-100, 100); }

template <>
auto UtilityToStringTest<double>::GetValue() const -> double { return test_helpers::RandomDouble(-100, 100); }

template <><commit_msg>Added test for to_string to check for types that have no conversion.<commit_after>#include "utility/to_string.hpp"

#include "domain/mesh/factory.hpp"
#include "instrumentation/converter/factory.hpp"
#include "instrumentation/outstream/factory.hpp"
#include "solver/group/factory.hpp"
#include "solver/linear/factory.hpp"
#include "test_helpers/gmock_wrapper.h"
#include "test_helpers/test_helper_functions.h"

namespace  {

namespace utility = bart::utility;
namespace converter = bart::instrumentation::converter;
namespace test_helpers = bart::test_helpers;

using MeshName = bart::domain::mesh::MeshName;
using ConverterName = converter::ConverterName;
using OutstreamName = bart::instrumentation::outstream::OutstreamName;
using GroupSolverName = bart::solver::group::GroupSolverName;
using LinearSolverName = bart::solver::linear::LinearSolverName;

struct NoStringConversionType{};

template <typename T>
class UtilityToStringTest : public ::testing::Test {
 public:
  [[nodiscard]] auto GetValue() const -> T;
};

using TestTypes = ::testing::Types<int, double, ConverterName, MeshName, OutstreamName, GroupSolverName, LinearSolverName, NoStringConversionType>;
TYPED_TEST_SUITE(UtilityToStringTest, TestTypes);

template <>
auto UtilityToStringTest<int>::GetValue() const -> int { return test_helpers::RandomInt(-100, 100); }

template <>
auto UtilityToStringTest<NoStringConversionType>::GetValue() const -> NoStringConversionType {
  return NoStringConversionType(); }

template <>
auto UtilityToStringTest<double>::GetValue() const -> double { return test_helpers::RandomDouble(-100, 100); }

template <>
{'fraction_non_alphanumeric': 0.12575655682582382, 'fraction_numerical': 0.008069939475453935, 'mean_word_length': 8.355345911949685, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 26, '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': '5547214', 'n_tokens_mistral': 930, 'n_tokens_neox': 889, 'n_words': 185}