nb::Error objects now working

This commit is contained in:
NaifBanana
2026-05-18 01:35:28 -05:00
parent 18de24649a
commit 0b5189dd2c
5 changed files with 111 additions and 110 deletions
+3 -10
View File
@@ -3,9 +3,8 @@
#include <gtest/gtest.h>
#include "Errors.hpp"
#include <iostream>
#include <string>
#include "TypeTraits.hpp"
#include "Utils.hpp"
using namespace nb;
@@ -36,12 +35,6 @@ const ErrorCodeMap TestError::ErrorMessages{
TEST(ErrorTest, Test) {
auto err = TestError(0, TestError(1));
nb::stream(std::cout,
"len string: ", err.what_str().length(), "\n",
"len wstring: ", err.what_str<std::wstring>().length(), "\n"
);
nb::stream(std::wcout,
err.what_str<std::wstring>(), L"\n"
);
auto err = TestError(0, TestError(1, TestError(2, TestError(3, TestError(2)))));
ASSERT_STREQ(err.what(), "Hey!\n Trace: How\n Trace: You\n Trace: Doin\n Trace: You\n");
}
-1
View File
@@ -1,4 +1,3 @@
#include <iterator>
#define CODE_ERROR_LOCATIONS
#include <gtest/gtest.h>