<commit_before>import pytest

from thinglang.runner import run


def test_simple_conditionals():
    assert run("""
thing Program
    does start
        if "dog" eq "dog"
            Output.write("dog is dog")

        if "dog" eq "cat"
            Output.write("dog is cat")

    """).output == """dog is dog""".strip()


def test_unconditional_else():
    assert run("""
thing Program
    does start
        if "dog" eq "dog"
            Output.write("dog is dog")
        otherwise
            Output.write("dog is not dog")

        if "dog" eq "cat"
            Output.write("dog is cat")
        otherwise
            Output.write("dog is not cat")
    """).output == """dog is dog\ndog is not cat""".strip()


def test_conditional_else():
    assert run("""
thing Program
    does start
        if "dog" eq "cat"
            Output.write("dog is cat")
        otherwise if "dog" eq "dog"
            Output.write("dog is dog")
        otherwise
            Output.write("dog is not dog and not cat")
    """).output == """dog is dog\ndog is not cat""".strip()<commit_msg>Update conditional else branch tests<commit_after>import pytest

from thinglang.runner import run


def test_simple_conditionals():
    assert run("""
thing Program
    does start
        if "dog" eq "dog"
            Output.write("dog is dog")

        if "dog" eq "cat"
            Output.write("dog is cat")

    """).output == """dog is dog""".strip()


def test_unconditional_else():
    assert run("""
thing Program
    does start
        if "dog" eq "dog"
            Output.write("dog is dog")
        otherwise
            Output.write("dog is not dog")

        if "dog" eq "cat"
            Output.write("dog is cat")
        otherwise
            Output.write("dog is not cat")
    """).output == """dog is dog\ndog is not cat""".strip()


def test_conditional_else():
    assert run("""
thing Program
    does start
        if "dog" eq "cat"
            Output.write("dog is cat")
        otherwise if "dog" eq "dog"
            Output.write("dog is dog")
        otherwise if "dog" eq "dog"
            Output.write("dog is still dog")
        otherwise
            Output.write("dog is not dog and not cat")

        if "dog" eq "cat"
            Output.write("dog is cat")
        otherwise if "dog" eq "Dog"
            Output.write("dog is Dog")
        otherwise if "dog" eq "mouse"
            Output.write("dog is mouse")
        otherwise
            Output.write("dog is not cat and not mouse and not Dog")
    """).output == """dog is dog\ndog is not cat and not mouse and not Dog""".strip()
{'fraction_non_alphanumeric': 0.1268800617045893, 'fraction_numerical': 0.0, 'mean_word_length': 1.9816091954022987, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6116336', 'n_tokens_mistral': 750, 'n_tokens_neox': 732, 'n_words': 270}