include(cmake_test/cmake_test)

ct_add_test("assert_true")
    include(cmake_test/asserts/true_false)

    ct_add_section("is truthy")
        ct_add_section("is 1")
            set(is_1 1)
            ct_assert_true(is_1)
        ct_end_section()

        ct_add_section("is ON")
            set(is_on ON)
            ct_assert_true(is_on)
        ct_end_section()

        ct_add_section("is YES")
            set(is_yes YES)
            ct_assert_true(is_yes)
        ct_end_section()

        ct_add_section("is TRUE")
            set(is_true TRUE)
            ct_assert_true(is_true)
        ct_end_section()

        ct_add_section("is Y")
            set(is_y Y)
            ct_assert_true(is_y)
        ct_end_section()

        ct_add_section("is non-zero number")
            set(is_non_zero_1 100)
            set(is_non_zero_2 1234)
            ct_assert_true(is_non_zero_1)
            ct_assert_true(is_non_zero_2)
        ct_end_section()

        ct_add_section("is a non-falsey string")
            set(is_a_non_falsey_string "a non-falsey string")
            ct_assert_true(is_a_non_falsey_string)
        ct_end_section()
    ct_end_section()

    ct_add_section("is falsey")
        ct_add_section("is 0")
            set(is_0 0)
            ct_assert_true(is_0)
            ct_assert_fails_as("is_0 is not true.")
        ct_end_section()

        ct_add_section("is OFF")
            set(is_off OFF)
            ct_assert_true(is_off)
            ct_assert_fails_as("is_off is not true.")
        ct_end_section()

        ct_add_section("is NO")
            set(is_no NO)
            ct_assert_true(is_no)
            ct_assert_fails_as("is_no is not true.")
        ct_end_section()

        ct_add_section("is FALSE")
            set(is_false FALSE)
            ct_assert_true(is_false)
            ct_assert_fails_as("is_false is not true.")
        ct_end_section()

        ct_add_section("is N")
            set(is_n N)
            ct_assert_true(is_n)
            ct_assert_fails_as("is_n is not true.")
        ct_end_section()

        ct_add_section("is IGNORE")
            set(is_ignore IGNORE)
            ct_assert_true(is_ignore)
            ct_assert_fails_as("is_ignore is not true.")
        ct_end_section()

        ct_add_section("is NOTFOUND")
            set(is_notfound NOTFOUND)
            ct_assert_true(is_notfound)
            ct_assert_fails_as("is_notfound is not true.")
        ct_end_section()

        ct_add_section("is empty string")
            set(is_empty_string "")
            ct_assert_true(is_empty_string)
            ct_assert_fails_as("is_empty_string is not true.")
        ct_end_section()

        ct_add_section("ends with -NOTFOUND")
            set(ends_with_notfound "something-NOTFOUND")
            ct_assert_true(ends_with_notfound)
            ct_assert_fails_as("ends_with_notfound is not true.")
        ct_end_section()
    ct_end_section()
ct_end_test()

ct_add_test("false")
    include(cmake_test/asserts/true_false)

    ct_add_section("is falsey")
        ct_add_section("is 0")
            set(is_0 0)
            ct_assert_false(is_0)
        ct_end_section()

        ct_add_section("is OFF")
            set(is_off OFF)
            ct_assert_false(is_off)
        ct_end_section()

        ct_add_section("is NO")
            set(is_no NO)
            ct_assert_false(is_no)
        ct_end_section()

        ct_add_section("is FALSE")
            set(is_false FALSE)
            ct_assert_false(is_false)
        ct_end_section()

        ct_add_section("is N")
            set(is_n N)
            ct_assert_false(is_n)
        ct_end_section()

        ct_add_section("is IGNORE")
            set(is_ignore IGNORE)
            ct_assert_false(is_ignore)
        ct_end_section()

        ct_add_section("is NOTFOUND")
            set(is_notfound NOTFOUND)
            ct_assert_false(is_notfound)
        ct_end_section()

        ct_add_section("is empty string")
            set(is_empty_string "")
            ct_assert_false(is_empty_string)
        ct_end_section()

        ct_add_section("ends with -NOTFOUND")
            set(ends_with_notfound "something-NOTFOUND")
            ct_assert_false(ends_with_notfound)
        ct_end_section()
    ct_end_section()

    ct_add_section("is truthy")
        ct_add_section("is 1")
            set(is_1 1)
            ct_assert_false(is_1)
            ct_assert_fails_as("is_1 is not false.")
        ct_end_section()

        ct_add_section("is ON")
            set(is_on ON)
            ct_assert_false(is_on)
            ct_assert_fails_as("is_on is not false.")
        ct_end_section()

        ct_add_section("is YES")
            set(is_yes YES)
            ct_assert_false(is_yes)
            ct_assert_fails_as("is_yes is not false.")
        ct_end_section()

        ct_add_section("is TRUE")
            set(is_true TRUE)
            ct_assert_false(is_true)
            ct_assert_fails_as("is_true is not false.")
        ct_end_section()

        ct_add_section("is Y")
            set(is_y Y)
            ct_assert_false(is_y)
            ct_assert_fails_as("is_y is not false.")
        ct_end_section()

        ct_add_section("is non-zero number")
            set(is_non_zero 100)
            ct_assert_false(is_non_zero)
            ct_assert_fails_as("is_non_zero is not false.")
        ct_end_section()

        ct_add_section("is a non-falsey string")
            set(is_a_non_falsey_string "a non-falsey string")
            ct_assert_false(is_a_non_falsey_string)
            ct_assert_fails_as("is_a_non_falsey_string is not false.")
        ct_end_section()
    ct_end_section()
ct_end_test()
