<commit_before>// Copyright 2008 <NAME>

#include "common_headers.h"

#include "circa.h"
#include "tests/common.h"

namespace circa {
namespace primitive_type_tests {

void strings()
{
    Branch* branch = new Branch();
    Term* str1 = constant_string(branch, "one");
    Term* str2 = constant_string(branch, "two");

    test_assert(as_string(str1) == "one");
    test_assert(as_string(str2) == "two");
    
    duplicate_value(str1,str2);

    test_assert(as_string(str1) == "one");
    test_assert(as_string(str2) == "one");
}

} // namespace primitive_type_tests

void register_primitive_type_tests()
{
    REGISTER_TEST_CASE(primitive_type_tests::strings);
}

} // namespace circa<commit_msg>Add a test case for some builtin objects<commit_after>// Copyright 2008 <NAME>

#include "common_headers.h"

#include "circa.h"
#include "tests/common.h"

namespace circa {
namespace primitive_type_tests {

void strings()
{
    Branch* branch = new Branch();
    Term* str1 = constant_string(branch, "one");
    Term* str2 = constant_string(branch, "two");

    test_assert(as_string(str1) == "one");
    test_assert(as_string(str2) == "two");
    
    duplicate_value(str1,str2);

    test_assert(as_string(str1) == "one");
    test_assert(as_string(str2) == "one");
}

void builtin_objects()
{
    test_assert(KERNEL->findNamed("int") == INT_TYPE);
    test_assert(KERNEL->findNamed("float") == FLOAT_TYPE);
    test_assert(KERNEL->findNamed("string") == STRING_TYPE);
    test_assert(KERNEL->findNamed("bool") == BOOL_TYPE);
}

} // namespace primitive_type_tests

void register_primitive_type_tests()
{
    REGISTER_TEST_CASE(primitive_type_tests::strings);
    REGISTER_TEST_CASE(primitive_type_tests::builtin_objects);
}

} // namespace circa
{'fraction_non_alphanumeric': 0.14719358533791524, 'fraction_numerical': 0.013745704467353952, 'mean_word_length': 5.024137931034483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '4021967', 'n_tokens_mistral': 609, 'n_tokens_neox': 604, 'n_words': 105}