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

#include <memory>
#include <string>

#include <cassert>

#include "actions.h"

using std::string;

int pull_test_actions() { return 0; }

// some primitive definitions for testing

class SetField : public ActionPrimitive<Field &, Data &> {
  void operator ()(Field &f, Data &d) {
    f.set(d);
  }
};

REGISTER_PRIMITIVE(SetField);

class Add : public ActionPrimitive<Field &, Data &, Data &> {
  void operator ()(Field &f, Data &d1, Data &d2) {
    f.add(d1, d2);
  }
};

REGISTER_PRIMITIVE(Add);

class RemoveHeader : public ActionPrimitive<Header &> {
  void operator ()(Header &hdr) {
    hdr.mark_invalid();
  }
};

REGISTER_PRIMITIVE(RemoveHeader);

class CopyHeader : public ActionPrimitive<Header &, Header &> {
  void operator ()(Header &dst, Header &src) {
    if(!src.is_valid()) return;
    dst.mark_valid();
    assert(dst.get_header_type_id() == src.get_header_type_id());
    for(unsigned int i = 0; i < dst.size(); i++) {<commit_msg>added const qualifiers when appropriate to primitive defs in test_actions<commit_after>#include <gtest/gtest.h>

#include <memory>
#include <string>

#include <cassert>

#include "actions.h"

using std::string;

int pull_test_actions() { return 0; }

// some primitive definitions for testing

class SetField : public ActionPrimitive<Field &, const Data &> {
  void operator ()(Field &f, const Data &d) {
    f.set(d);
  }
};

REGISTER_PRIMITIVE(SetField);

class Add : public ActionPrimitive<Field &, const Data &, const Data &> {
  void operator ()(Field &f, const Data &d1, const Data &d2) {
    f.add(d1, d2);
  }
};

REGISTER_PRIMITIVE(Add);

class RemoveHeader : public ActionPrimitive<Header &> {
  void operator ()(Header &hdr) {
    hdr.mark_invalid();
  }
};

REGISTER_PRIMITIVE(RemoveHeader);

class CopyHeader : public ActionPrimitive<Header &, const Header &> {
  void operator ()(Header &dst, const Header &src) {
    if(!src.is_valid()) return;
    dst.mark_valid();
    assert(dst.get_header_type_id() == src.get_header_type_id());
    for(unsigned int i = 0; i < dst.size(); i++) {
{'fraction_non_alphanumeric': 0.14942528735632185, 'fraction_numerical': 0.005747126436781609, 'mean_word_length': 4.4119170984455955, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '6123104', 'n_tokens_mistral': 726, 'n_tokens_neox': 733, 'n_words': 185}