From a1f23f4759499b28b181b8fe93da645cf143aeac Mon Sep 17 00:00:00 2001 From: Hossein Moein Date: Wed, 15 May 2024 14:26:05 -0400 Subject: [PATCH] Added a view to testing writing binary --- test/dataframe_tester_3.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test/dataframe_tester_3.cc b/test/dataframe_tester_3.cc index d4f8b23e..5fc5d5f2 100644 --- a/test/dataframe_tester_3.cc +++ b/test/dataframe_tester_3.cc @@ -3782,13 +3782,24 @@ static void test_writing_binary() { try { df.read("SHORT_IBM.csv", io_format::csv2); - df.write("./SHORT_IBM.csv", io_format::csv); - df.write("./SHORT_IBM.csv2", io_format::csv2); - df.write("./SHORT_IBM.dat", io_format::binary); + df.write("./SHORT_IBM_dup.csv", io_format::csv); + df.write("./SHORT_IBM_dup.csv2", io_format::csv2); + df.write("./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( + { "IBM_Open", "IBM_High", "IBM_Close", "IBM_Volume" }); + + vw.write("./FROM_VW_SHORT_IBM.csv", io_format::csv); + vw.write("./FROM_VW_SHORT_IBM.csv2", io_format::csv2); + vw.write("./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;