<commit_before>#include <gtest/gtest.h>
#include "WindowEvaluator.h"
#include "SystemState.hpp"
#include "Configuration.hpp"

using namespace Geometry2d;


Configuration config;


// Places a robot on the field that counts as an obstacle to the window
// evaluator, but is not actuallly in the way.  Should return one segment as
// the result.
TEST(WindowEvaluator, eval_pt_to_seg) {
    // setup config system because window evaulator relies on it
    for (Configurable *obj :  Configurable::configurables()) {
        obj->createConfiguration(&config);
    }

    SystemState state;
    OurRobot *obstacleBot = state.self[0];
    obstacleBot->visible = true;
    obstacleBot->pos = Point(1, 1);

    Segment ourGoalSegment(
        Point(-Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0),
        Point(Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0));

    WindowEvaluator winEval(&state);
    WindowingResult result = winEval.eval_pt_to_seg(Point(1, 2), ourGoalSegment);

    auto& windows = result.first;
    auto& best = result.second;

    // there should be a best window, there's nothing in the way
    EXPECT_NE(boost::none, best);

    // there should only be one window
    EXPECT_EQ(1, windows.size());

    // the window should be our goal segment<commit_msg>adjusted windowing test case to fail<commit_after>#include <gtest/gtest.h>
#include "WindowEvaluator.h"
#include "SystemState.hpp"
#include "Configuration.hpp"

using namespace Geometry2d;


Configuration config;


// Places a robot on the field that counts as an obstacle to the window
// evaluator, but is not actuallly in the way.  Should return one segment as
// the result.
TEST(WindowEvaluator, eval_pt_to_seg) {
    // setup config system because window evaulator relies on it
    for (Configurable *obj :  Configurable::configurables()) {
        obj->createConfiguration(&config);
    }

    SystemState state;
    OurRobot *obstacleBot = state.self[0];
    obstacleBot->visible = true;
    obstacleBot->pos = Point(1, 1);

    Segment ourGoalSegment(
        Point(Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0),
        Point(-Field_Dimensions::Current_Dimensions.GoalWidth() / 2.0, 0));

    WindowEvaluator winEval(&state);
    WindowingResult result = winEval.eval_pt_to_seg(Point(1, 2), ourGoalSegment);

    auto& windows = result.first;
    auto& best = result.second;

    // there should be a best window, there's nothing in the way
    EXPECT_NE(boost::none, best);

    // there should only be one window
    EXPECT_EQ(1, windows.size());

    // the window should be our goal segment
{'fraction_non_alphanumeric': 0.10570662581386442, 'fraction_numerical': 0.00995787054768288, 'mean_word_length': 3.664285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '4015617', 'n_tokens_mistral': 828, 'n_tokens_neox': 790, 'n_words': 238}