Skip to content

Commit

Permalink
Added a view to testing writing binary
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmoein committed May 15, 2024
1 parent 30c4213 commit a1f23f4
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/dataframe_tester_3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3782,13 +3782,24 @@ static void test_writing_binary() {

try {
df.read("SHORT_IBM.csv", io_format::csv2);
df.write<double, long>("./SHORT_IBM.csv", io_format::csv);
df.write<double, long>("./SHORT_IBM.csv2", io_format::csv2);
df.write<double, long>("./SHORT_IBM.dat", io_format::binary);
df.write<double, long>("./SHORT_IBM_dup.csv", io_format::csv);
df.write<double, long>("./SHORT_IBM_dup.csv2", io_format::csv2);
df.write<double, long>("./SHORT_IBM_dup.dat", io_format::binary);

std::remove("./SHORT_IBM.csv");
std::remove("./SHORT_IBM.csv2");
std::remove("./SHORT_IBM.data");
auto vw =
df.get_view<double, long>(
{ "IBM_Open", "IBM_High", "IBM_Close", "IBM_Volume" });

vw.write<double, long>("./FROM_VW_SHORT_IBM.csv", io_format::csv);
vw.write<double, long>("./FROM_VW_SHORT_IBM.csv2", io_format::csv2);
vw.write<double, long>("./FROM_VW_SHORT_IBM.dat", io_format::binary);

std::remove("./SHORT_IBM_dup.csv");
std::remove("./SHORT_IBM_dup.csv2");
std::remove("./SHORT_IBM_dup.dat");
std::remove("./FROM_VW_SHORT_IBM.csv");
std::remove("./FROM_VW_SHORT_IBM.csv2");
std::remove("./FROM_VW_SHORT_IBM.dat");
}
catch (const DataFrameError &ex) {
std::cout << ex.what() << std::endl;
Expand Down

0 comments on commit a1f23f4

Please sign in to comment.