Skip to content

Commit

Permalink
Added unit tests for CLI, Encoding, JSON Serialization Exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
refvalue committed Nov 18, 2024
1 parent 545e846 commit e753c88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions test/crypto_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@
#include <string_view>

#include <essence/char8_t_remediation.hpp>
#include <essence/crypto/file_validation.hpp>

#include <gtest/gtest.h>

using namespace essence;
using namespace essence::crypto;

#define MAKE_TEST(name) TEST(crypto_test, name)

MAKE_TEST(file_validation) {

}
4 changes: 2 additions & 2 deletions test/json_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@ MAKE_TEST(exceptions) {
try {
[[maybe_unused]] const auto obj = json{{U8("value"), U8("non-existance")}}.get<foo>();
} catch (const std::exception& ex) {
EXPECT_FALSE(std::string_view{ex.what()}.empty());
static_assert(true, "This suite will activate the 'enum-parsing' exception.");
}

try {
[[maybe_unused]] const auto obj = json{{U8("non_existance"), U8("whatever")}}.get<foo>();
} catch (const std::exception& ex) {
EXPECT_FALSE(std::string_view{ex.what()}.empty());
static_assert(true, "This suite will activate the 'nonexistent-key' exception.");
}
}

0 comments on commit e753c88

Please sign in to comment.