-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSliceOf.equals.test.cpp
More file actions
39 lines (28 loc) · 966 Bytes
/
SliceOf.equals.test.cpp
File metadata and controls
39 lines (28 loc) · 966 Bytes
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
36
37
38
39
#include "SliceOf.carray.h"
#include "SliceOf.equals.h"
using namespace array19;
void constexpr_SliceOf_equals_test() {
constexpr static int a[3] = {1, 2, 3};
constexpr auto as = sliceOfCArray(a);
constexpr static int b[3] = {1, 2, 3};
constexpr auto bs = amendSliceOfCArray(b);
static_assert(as == bs);
}
void constexpr_SliceOf_equals_empty_test() {
constexpr auto as = SliceOf<int>{};
constexpr auto bs = SliceOf<int>{};
static_assert(as == bs);
}
void constexpr_SliceOf_equals_count_differ_test() {
constexpr static int a[3] = {1, 2, 3};
constexpr auto as = sliceOfCArray(a);
constexpr auto bs = SliceOf<const int>{};
static_assert(as != bs);
}
void constexpr_SliceOf_equals_value_differ_test() {
constexpr static int a[3] = {1, 2, 3};
constexpr auto as = sliceOfCArray(a);
constexpr static int b[3] = {1, 99, 3};
constexpr auto bs = amendSliceOfCArray(b);
static_assert(as != bs);
}