MCPcopy Create free account
hub / github.com/d99kris/rapidcsv / main

Function main

tests/test018.cpp:6–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "unittest.h"
5
6int main()
7{
8 int rv = 0;
9
10 std::string csvref =
11 "B,C\n"
12 "4,16\n"
13 "9,81\n"
14 "16,256\n"
15 "25,625\n"
16 ;
17
18 std::string csv =
19 "A,B,C,D\n"
20 "2,4,16,256\n"
21 "3,9,81,6561\n"
22 "4,16,256,65536\n"
23 "5,25,625,390625\n"
24 ;
25
26 std::string path = unittest::TempPath();
27 unittest::WriteFile(path, csv);
28
29 try
30 {
31 rapidcsv::Document doc(path);
32
33 doc.RemoveColumn("D");
34 doc.RemoveColumn(0);
35
36 doc.Save();
37
38 std::string csvread = unittest::ReadFile(path);
39
40 unittest::ExpectEqual(std::string, csvref, csvread);
41 }
42 catch (const std::exception& ex)
43 {
44 std::cout << "exception: " << ex.what() << std::endl;
45 rv = 1;
46 }
47
48 unittest::DeleteFile(path);
49
50 return rv;
51}

Callers

nothing calls this directly

Calls 7

TempPathFunction · 0.85
WriteFileFunction · 0.85
ReadFileFunction · 0.85
DeleteFileFunction · 0.85
RemoveColumnMethod · 0.80
SaveMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected