mirror of
https://github.com/hyprwm/hyprutils.git
synced 2024-11-17 02:35:58 +01:00
20 lines
1.4 KiB
C++
20 lines
1.4 KiB
C++
#pragma once
|
|
#include <iostream>
|
|
|
|
namespace Colors {
|
|
constexpr const char* RED = "\x1b[31m";
|
|
constexpr const char* GREEN = "\x1b[32m";
|
|
constexpr const char* YELLOW = "\x1b[33m";
|
|
constexpr const char* BLUE = "\x1b[34m";
|
|
constexpr const char* MAGENTA = "\x1b[35m";
|
|
constexpr const char* CYAN = "\x1b[36m";
|
|
constexpr const char* RESET = "\x1b[0m";
|
|
};
|
|
|
|
#define EXPECT(expr, val) \
|
|
if (const auto RESULT = expr; RESULT != (val)) { \
|
|
std::cout << Colors::RED << "Failed: " << Colors::RESET << #expr << ", expected " << #val << " but got " << RESULT << "\n"; \
|
|
ret = 1; \
|
|
} else { \
|
|
std::cout << Colors::GREEN << "Passed " << Colors::RESET << #expr << ". Got " << val << "\n"; \
|
|
}
|