Skip to content

Commit

Permalink
Fix util tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Jul 2, 2023
1 parent 33aa327 commit 2f29439
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/unittests/util/UtilTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
// SPDX-License-Identifier: MIT

#include "Test.h"
#include <catch2/matchers/catch_matchers_string.hpp>
#include <sstream>

#include "slang/util/Random.h"
#include "slang/util/ThreadPool.h"
#include "slang/util/TimeTrace.h"

#if __cpp_exceptions && defined(CI_BUILD)
using namespace Catch::Matchers;

#if __cpp_exceptions && defined(CI_BUILD) && SLANG_ASSERT_ENABLED
TEST_CASE("Assertions") {
int i = 4;
SLANG_ASSERT(i == 4);
Expand All @@ -23,10 +26,10 @@ TEST_CASE("TypeName test") {
CHECK(typeName<void>() == "void");

auto name = typeName<std::string>();
CHECK(name.find("std::basic_string<char") != std::string::npos);
CHECK_THAT(std::string(name), ContainsSubstring("basic_string<char"));

name = typeName<slang::ast::AssertionKind>();
CHECK(name.find("slang::ast::AssertionKind") != std::string::npos);
CHECK_THAT(std::string(name), ContainsSubstring("slang::ast::AssertionKind"));
}

TEST_CASE("createRandomGenerator construction") {
Expand Down

0 comments on commit 2f29439

Please sign in to comment.