| 98 | } |
| 99 | |
| 100 | TEST_F(TestPrettyPrint, PrimitiveType) { |
| 101 | std::vector<bool> is_valid = {true, true, false, true, false}; |
| 102 | |
| 103 | std::vector<int32_t> values = {0, 1, 2, 3, 4}; |
| 104 | static const char* expected = R"expected([ |
| 105 | 0, |
| 106 | 1, |
| 107 | null, |
| 108 | 3, |
| 109 | null |
| 110 | ])expected"; |
| 111 | CheckPrimitive<Int32Type, int32_t>({0, 10}, is_valid, values, expected); |
| 112 | |
| 113 | static const char* expected_na = R"expected([ |
| 114 | 0, |
| 115 | 1, |
| 116 | NA, |
| 117 | 3, |
| 118 | NA |
| 119 | ])expected"; |
| 120 | CheckPrimitive<Int32Type, int32_t>({0, 10, 2, "NA"}, is_valid, values, expected_na, |
| 121 | false); |
| 122 | |
| 123 | static const char* ex_in2 = R"expected( [ |
| 124 | 0, |
| 125 | 1, |
| 126 | null, |
| 127 | 3, |
| 128 | null |
| 129 | ])expected"; |
| 130 | CheckPrimitive<Int32Type, int32_t>({2, 10}, is_valid, values, ex_in2); |
| 131 | |
| 132 | static const char* ex_in2_w2 = R"expected( [ |
| 133 | 0, |
| 134 | 1, |
| 135 | null, |
| 136 | 3, |
| 137 | null |
| 138 | ])expected"; |
| 139 | CheckPrimitive<Int32Type, int32_t>({2, 2}, is_valid, values, ex_in2_w2); |
| 140 | |
| 141 | static const char* ex_in2_w1 = R"expected( [ |
| 142 | 0, |
| 143 | ... |
| 144 | null |
| 145 | ])expected"; |
| 146 | CheckPrimitive<Int32Type, int32_t>({2, 1}, is_valid, values, ex_in2_w1); |
| 147 | |
| 148 | std::vector<double> values2 = {0., 1., 2., 3., 4.}; |
| 149 | static const char* ex2 = R"expected([ |
| 150 | 0, |
| 151 | 1, |
| 152 | null, |
| 153 | 3, |
| 154 | null |
| 155 | ])expected"; |
| 156 | CheckPrimitive<DoubleType, double>({0, 10}, is_valid, values2, ex2); |
| 157 | static const char* ex2_in2 = R"expected( [ |
nothing calls this directly
no test coverage detected