<commit_before>/*
* Arduino JSON library
* <NAME> 2014 - MIT License
*/

#include "CppUnitTest.h"
#include "IndentedPrintDecorator.h"
#include "StringBuilder.h"

using namespace ArduinoJson::Internals;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace JsonGeneratorTests
{
    TEST_CLASS(IntentedPrintTests)
    {
        char buffer[1024];
        size_t returnValue;

    public:
        
        TEST_METHOD(EmptyString)
        {
            whenInputIs("");
            outputMustBe("");
        }

    private:

        void whenInputIs(const char input[])
        {
            StringBuilder sb(buffer, sizeof(buffer));
            IndentedPrintDecorator decorator(sb);

            returnValue = decorator.print(input);
        }<commit_msg>Added a test of an empty object<commit_after>/*
* Arduino JSON library
* <NAME> 2014 - MIT License
*/

#include "CppUnitTest.h"
#include "IndentedPrintDecorator.h"
#include "StringBuilder.h"

using namespace ArduinoJson::Internals;
using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace JsonGeneratorTests
{
    TEST_CLASS(IntentedPrintTests)
    {
        char buffer[1024];
        size_t returnValue;

    public:
        
        TEST_METHOD(EmptyString)
        {
            whenInputIs("");
            outputMustBe("");
        }

        TEST_METHOD(EmptyObject)
        {
            whenInputIs("{}");
            outputMustBe("{}");
        }

    private:

        void whenInputIs(const char input[])
        {
            StringBuilder sb(buffer, sizeof(buffer));
            IndentedPrintDecorator decorator(sb);

            returnValue = decorator.print(input);
        }
{'fraction_non_alphanumeric': 0.10113027959547888, 'fraction_numerical': 0.009518143961927425, 'mean_word_length': 2.411764705882353, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4497658', 'n_tokens_mistral': 487, 'n_tokens_neox': 466, 'n_words': 95}