test test test

This commit is contained in:
Thomas Fussell 2016-07-16 20:06:39 -04:00
parent 0502e1e2d4
commit 93a5bccac2
2 changed files with 13 additions and 5 deletions

View File

@ -89,20 +89,20 @@ cell cell_vector::front()
{
if (order_ == major_order::row)
{
return get_cell(ref_.get_top_left().get_column().index);
return ws_.get_cell(ref_.get_top_left());
}
return get_cell(ref_.get_top_left().get_row());
return ws_.get_cell(ref_.get_top_left());
}
cell cell_vector::back()
{
if (order_ == major_order::row)
{
return get_cell(ref_.get_bottom_right().get_column().index);
return ws_.get_cell(ref_.get_bottom_right());
}
return get_cell(ref_.get_top_left().get_row());
return ws_.get_cell(ref_.get_bottom_right());
}
cell cell_vector::get_cell(std::size_t index)

View File

@ -1058,6 +1058,8 @@ public:
auto ws = wb.get_active_sheet();
ws.get_cell("A2").set_value(3.14);
ws.get_cell("A3").set_value(true);
ws.get_cell("B2").set_value("text");
ws.get_cell("B3").set_value(false);
auto range = ws.get_range("A2:B3");
@ -1066,6 +1068,12 @@ public:
auto row_iter = row.begin();
auto cell = *row_iter;
TS_ASSERT_EQUALS(cell.get_value<double>(), 3.14);
TS_ASSERT_EQUALS(row.front().get_reference(), "A2");
row_iter++;
cell = *row_iter;
TS_ASSERT_EQUALS(cell.get_value<std::string>(), "text");
TS_ASSERT_EQUALS(row.back().get_reference(), "B2");
range_iter = range.end();
range_iter--;
@ -1110,7 +1118,7 @@ public:
ws1.create_named_range("rangey", "A2:A2");
TS_ASSERT_EQUALS(ws1[std::string("rangey")], ws1.get_range("A2:A2"));
TS_ASSERT_EQUALS(ws1[std::string("A2:A2")], ws1.get_range("A2:A2"));
TS_ASSERT_DIFFERS(ws1[std::string("rangey")], ws1.get_range("A2:A3"));
TS_ASSERT(ws1[std::string("rangey")] != ws1.get_range("A2:A3"));
TS_ASSERT_EQUALS(ws1[std::string("rangey")].get_cell("A1"), ws1.get_cell("A2"));
}