<commit_before>#include <agency/future.hpp>
#include <agency/new_executor_traits.hpp>
#include <iostream>
#include <cassert>

#include "test_executors.hpp"

template<class Executor>
void test()
{
  using executor_type = Executor;
  
  size_t n = 1;
  
  auto int_ready   = agency::detail::make_ready_future(0);
  auto void_ready  = agency::detail::make_ready_future();
  
  auto futures = std::make_tuple(std::move(void_ready), std::move(int_ready));
  
  std::mutex mut;
  executor_type exec;
  std::future<int> fut = agency::new_executor_traits<executor_type>::template when_all_execute_and_select<1>(exec, [&mut](int& x)
  {
    mut.lock();
    x += 1;
    mut.unlock();
  },
  std::move(futures));
  
  auto got = fut.get();
  
  assert(got == n);
  assert(exec.valid());
}

int main()
{
  using namespace test_executors;

  test<empty_executor>();
  test<single_agent_when_all_execute_and_select_executor>();
  test<multi_agent_when_all_execute_and_select_executor>();
  test<single_agent_then_execute_executor>();

  std::cout << "OK" << std::endl;

  return 0;
}
<commit_msg>Test all existing test executors in test_single_agent_when_all_execute_and_select.cpp<commit_after>#include <agency/future.hpp>
#include <agency/new_executor_traits.hpp>
#include <iostream>
#include <cassert>

#include "test_executors.hpp"

template<class Executor>
void test()
{
  using executor_type = Executor;
  
  size_t n = 1;
  
  auto int_ready   = agency::detail::make_ready_future(0);
  auto void_ready  = agency::detail::make_ready_future();
  
  auto futures = std::make_tuple(std::move(void_ready), std::move(int_ready));
  
  std::mutex mut;
  executor_type exec;
  std::future<int> fut = agency::new_executor_traits<executor_type>::template when_all_execute_and_select<1>(exec, [&mut](int& x)
  {
    mut.lock();
    x += 1;
    mut.unlock();
  },
  std::move(futures));
  
  auto got = fut.get();
  
  assert(got == n);
  assert(exec.valid());
}

int main()
{
  using namespace test_executors;

  test<empty_executor>();
  test<single_agent_when_all_execute_and_select_executor>();
  test<multi_agent_when_all_execute_and_select_executor>();
  test<single_agent_then_execute_executor>();
  test<multi_agent_execute_returning_user_defined_container_executor>();

  std::cout << "OK" << std::endl;

  return 0;
}

{'fraction_non_alphanumeric': 0.14291901255954959, 'fraction_numerical': 0.0043308791684712, 'mean_word_length': 5.507042253521127, 'pattern_counts': {'":': 0, '<': 36, '<?xml version=': 0, '>': 28, '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': '2366581', 'n_tokens_mistral': 860, 'n_tokens_neox': 837, 'n_words': 137}