<commit_before>#include <cassert>

#include "Vaca/Vaca.h"

using namespace Vaca;

template<class T>
void test_basic()
{
  // create with default style
  {
    Frame parent(L"title");
    T a(L"caption", &parent);
    T b(L"caption", &parent, T::Styles::Default);

    assert(a.getParent() == &parent);
    assert(b.getParent() == &parent);
    assert(a.getStyle() == b.getStyle());
    assert(a.getId() == 0);
    assert(b.getId() == 0);

    // check if get/setText work
    a.setText(L"bbb");
    assert(a.getText() == L"bbb");

    // check if get/setId work
    a.setId(32);
    b.setId(33);
    assert(a.getId() == 32);
    assert(b.getId() == 33);
  }

  // create without parent
  {
    T a(L"caption", NULL, T::Styles::Default - Widget::Styles::Visible);
    assert(a.getText() == L"caption");
    assert(a.getParent() == NULL);
  }
}

void test_nonexistent_class()
{
  try {
    Widget a(WidgetClassName(L"Vaca.NonExistentClass"), NULL, Widget::Styles::None);

    // CreateWidgetException wasn't throw
    assert(false);
  }
  catch (CreateWidgetException& e) {
    // expected behavior
  }
}

int main()
{<commit_msg>Fixed warning about unused variable in catch().<commit_after>#include <cassert>

#include "Vaca/Vaca.h"

using namespace Vaca;

template<class T>
void test_basic()
{
  // create with default style
  {
    Frame parent(L"title");
    T a(L"caption", &parent);
    T b(L"caption", &parent, T::Styles::Default);

    assert(a.getParent() == &parent);
    assert(b.getParent() == &parent);
    assert(a.getStyle() == b.getStyle());
    assert(a.getId() == 0);
    assert(b.getId() == 0);

    // check if get/setText work
    a.setText(L"bbb");
    assert(a.getText() == L"bbb");

    // check if get/setId work
    a.setId(32);
    b.setId(33);
    assert(a.getId() == 32);
    assert(b.getId() == 33);
  }

  // create without parent
  {
    T a(L"caption", NULL, T::Styles::Default - Widget::Styles::Visible);
    assert(a.getText() == L"caption");
    assert(a.getParent() == NULL);
  }
}

void test_nonexistent_class()
{
  try {
    Widget a(WidgetClassName(L"Vaca.NonExistentClass"), NULL, Widget::Styles::None);

    // CreateWidgetException wasn't throw
    assert(false);
  }
  catch (const CreateWidgetException&) {
    // expected behavior
  }
}

int main()
{
{'fraction_non_alphanumeric': 0.18526591107236268, 'fraction_numerical': 0.008718395815170008, 'mean_word_length': 3.281716417910448, 'pattern_counts': {'":': 0, '<': 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': '6399526', 'n_tokens_mistral': 834, 'n_tokens_neox': 825, 'n_words': 168}