| 117 | } |
| 118 | |
| 119 | int main() |
| 120 | { |
| 121 | std::vector<std::string> v1 = {"a", "b", "c"}; |
| 122 | std::cout << "Test 1: {a, b, c} with ', '" << std::endl; |
| 123 | auto r1 = args::detail::Join(v1, ", "); |
| 124 | std::cout << "Result: '" << r1 << "' (expected 'a, b, c')" << std::endl << std::endl; |
| 125 | |
| 126 | std::vector<std::string> v2 = {"alpha", "beta"}; |
| 127 | std::cout << "Test 2: {alpha, beta} with '\\n'" << std::endl; |
| 128 | auto r2 = args::detail::Join(v2, "\n"); |
| 129 | std::cout << "Result: '" << r2 << "' (expected 'alpha\\nbeta')" << std::endl << std::endl; |
| 130 | |
| 131 | std::vector<std::string> v3 = {}; |
| 132 | std::cout << "Test 3: {} with ', '" << std::endl; |
| 133 | auto r3 = args::detail::Join(v3, ", "); |
| 134 | std::cout << "Result: '" << r3 << "' (expected '')" << std::endl << std::endl; |
| 135 | |
| 136 | std::vector<std::string> v4 = {"single"}; |
| 137 | std::cout << "Test 4: {single} with ', '" << std::endl; |
| 138 | auto r4 = args::detail::Join(v4, ", "); |
| 139 | std::cout << "Result: '" << r4 << "' (expected 'single')" << std::endl; |
| 140 | |
| 141 | return 0; |
| 142 | } |