mirror of
https://github.com/alexhopeoconnor/arduino-home-assistant.git
synced 2026-10-20 18:01:30 +10:00
Replace the legacy tests/ tree (AUnit, EpoxyDuino, Make, AUniter) with PlatformIO Unity suites under test/, shared helpers, and platformio.ini. Remove AUnitHelpers and drop the AUnit include from ArduinoHA test builds. Refresh docs to Markdown-only and document the test workflow in CHANGELOG.
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
#include <Arduino.h>
|
|
#include <ArduinoHA.h>
|
|
#include "../../shared/aha_unity_helpers.h"
|
|
|
|
void test_UtilsTest_ends_with_null_str(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith(nullptr, "test"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_null_suffix(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith("test", nullptr));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_valid_1(void)
|
|
{
|
|
TEST_ASSERT_TRUE(HAUtils::endsWith("test", "st"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_valid_2(void)
|
|
{
|
|
TEST_ASSERT_TRUE(HAUtils::endsWith("test/abc", "/abc"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_valid_3(void)
|
|
{
|
|
TEST_ASSERT_TRUE(HAUtils::endsWith("test123", "3"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_invalid_1(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith("test", "ST"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_invalid_2(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith("test", ""));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_invalid_3(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith("test123", "2"));
|
|
}
|
|
|
|
void test_UtilsTest_ends_with_invalid_4(void)
|
|
{
|
|
TEST_ASSERT_FALSE(HAUtils::endsWith("test", "testtest"));
|
|
}
|