| 4 | #include "unittest.h" |
| 5 | |
| 6 | int main() |
| 7 | { |
| 8 | int rv = 0; |
| 9 | |
| 10 | std::string csv = |
| 11 | "-,A,B,C\n" |
| 12 | "1,3,9,81\n" |
| 13 | "2,4,16,256\n" |
| 14 | ; |
| 15 | |
| 16 | std::string path = unittest::TempPath(); |
| 17 | unittest::WriteFile(path, csv); |
| 18 | |
| 19 | std::string pathcopy = unittest::TempPath(); |
| 20 | |
| 21 | try |
| 22 | { |
| 23 | rapidcsv::Document doc(path, rapidcsv::LabelParams(0, 0)); |
| 24 | |
| 25 | rapidcsv::Document doccopy(doc); |
| 26 | |
| 27 | doccopy.Save(pathcopy); |
| 28 | |
| 29 | std::string csvread = unittest::ReadFile(pathcopy); |
| 30 | |
| 31 | unittest::ExpectEqual(std::string, csv, csvread); |
| 32 | } |
| 33 | catch (const std::exception& ex) |
| 34 | { |
| 35 | std::cout << "exception: " << ex.what() << std::endl; |
| 36 | rv = 1; |
| 37 | } |
| 38 | |
| 39 | unittest::DeleteFile(path); |
| 40 | unittest::DeleteFile(pathcopy); |
| 41 | |
| 42 | return rv; |
| 43 | } |
nothing calls this directly
no test coverage detected