| 250 | } |
| 251 | |
| 252 | int test() { |
| 253 | TextPrinter tp; |
| 254 | auto cases = test_cases(); |
| 255 | int ret_code = 0; |
| 256 | for (const auto &[in, out, cfg]: cases) { |
| 257 | auto res = transform_syntax("test.das", in, cfg); // any filename |
| 258 | if (!res.ok) { |
| 259 | tp << "input:\n" << in << " \noutput:\n" << res.error->content << " \nerror:\n" << res.error->what |
| 260 | << "\n"; |
| 261 | ret_code = -1; |
| 262 | } else if (res.ok != out) { |
| 263 | tp << " output:\n" << res.ok.value() << "\nexpected:\n" << out << "\n"; |
| 264 | ret_code = -1; |
| 265 | } |
| 266 | } |
| 267 | return ret_code; |
| 268 | } |
| 269 | |
| 270 | int main(int argc, char** argv) { |
| 271 | format::FormatOptions opts; |
no test coverage detected