<commit_before>// Copyright (c) 2017 <NAME>
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#include <bandit/bandit.h>
#include "core/utils.h"

using namespace bandit;
using namespace snowhouse;
using namespace CodeHero;

go_bandit([]() {
    describe("::StartsWith", [] {
        it("should return true if starts we correct prefix", [] {
            AssertThat(StartsWith("This is a test", "This"), IsTrue());
        });

        it("should return true if the prefix is empty", [] {
            AssertThat(StartsWith("This is a test", ""), IsTrue());
        });

        it("should return false if the prefix doesn't match the start of the string", [] {
            AssertThat(StartsWith("This is a test", "Wrong"), IsFalse());
        });
    });

    describe("::EndsWith", [] {
        it("should return true if ends with correct suffix", [] {
            AssertThat(EndsWith("This is a test", "test"), IsTrue());
        });

        it("should return true if suffix is empty", [] {
            AssertThat(EndsWith("This is a test", ""), IsTrue());
        });

        it("should return false if the suffix doesn't match the end of the string", [] {
            AssertThat(EndsWith("This is a test", "wrong"), IsFalse());
        });
    });
});<commit_msg>Added more cases for StartsWith/EndsWith tests<commit_after>// Copyright (c) 2017 <NAME>
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#include <bandit/bandit.h>
#include "core/utils.h"

using namespace bandit;
using namespace snowhouse;
using namespace CodeHero;

go_bandit([]() {
    describe("::StartsWith", [] {
        it("should return true if starts we correct prefix", [] {
            AssertThat(StartsWith("This is a test", "This"), IsTrue());
            AssertThat(StartsWith("This is a test", "This is a test"), IsTrue());
        });

        it("should return true if the prefix is empty", [] {
            AssertThat(StartsWith("This is a test", ""), IsTrue());
        });

        it("should return false if the prefix doesn't match the start of the string", [] {
            AssertThat(StartsWith("This is a test", "Wrong"), IsFalse());
            AssertThat(StartsWith("This is a test", "This iz"), IsFalse());
            AssertThat(StartsWith("This is a test", "Zhis is"), IsFalse());
        });
    });

    describe("::EndsWith", [] {
        it("should return true if ends with correct suffix", [] {
            AssertThat(EndsWith("This is a test", "test"), IsTrue());
            AssertThat(EndsWith("This is a test", "This is a test"), IsTrue());
        });

        it("should return true if suffix is empty", [] {
            AssertThat(EndsWith("This is a test", ""), IsTrue());
        });

        it("should return false if the suffix doesn't match the end of the string", [] {
            AssertThat(EndsWith("This is a test", "wrong"), IsFalse());
            AssertThat(EndsWith("This is a test", "tesz"), IsFalse());
            AssertThat(EndsWith("This is a test", "zest"), IsFalse());
        });
    });
});
{'fraction_non_alphanumeric': 0.15328, 'fraction_numerical': 0.00256, 'mean_word_length': 2.6819787985865724, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, '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': '6864733', 'n_tokens_mistral': 865, 'n_tokens_neox': 870, 'n_words': 311}