Echo Writes Code

test_utility.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "crucible/core.hpp"
#include "crucible/test.hpp"

namespace test_utility
{
  constexpr auto none_a = crucible::make_none();

  constexpr auto none_b = crucible::make_none();

  static_assert(none_a == none_b);

  static_assert(!(none_a != none_b));

  static_assert(!(none_a < none_b));

  static_assert(!(none_a > none_b));

  static_assert(none_a <= none_b);

  static_assert(none_a >= none_b);

  CRUCIBLE_SCENARIO(utility, default_construct_trivial_type)
  {
    int const x { crucible::construct<int>() };
    CRUCIBLE_EXPECT_EQ(x, 0);
  }

  CRUCIBLE_SCENARIO(utility, default_construct_nontrivial_type)
  {
    std::string const s { crucible::construct<std::string>() };
    CRUCIBLE_EXPECT_EQ(s, "");
  }
}

CRUCIBLE_BOOT(crucible::test::shell)