tests: unit: csv: qualify 'read_csv' tests better
This commit is contained in:
parent
23b71018ac
commit
3539cd4a34
|
@ -5,31 +5,31 @@
|
||||||
// Allow namespace pollution in tests for convenience
|
// Allow namespace pollution in tests for convenience
|
||||||
using namespace kraken::csv;
|
using namespace kraken::csv;
|
||||||
|
|
||||||
TEST(csv, empty) {
|
TEST(read_csv, empty) {
|
||||||
auto const expected = csv_type{};
|
auto const expected = csv_type{};
|
||||||
ASSERT_EQ(read_csv(""), expected);
|
ASSERT_EQ(read_csv(""), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(csv, skip_header) {
|
TEST(read_csv, skip_header) {
|
||||||
auto const expected = csv_type{};
|
auto const expected = csv_type{};
|
||||||
ASSERT_EQ(read_csv("a,b,c"), expected);
|
ASSERT_EQ(read_csv("a,b,c"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(csv, do_not_skip_header) {
|
TEST(read_csv, do_not_skip_header) {
|
||||||
auto const expected = csv_type{
|
auto const expected = csv_type{
|
||||||
{"a", "b", "c"},
|
{"a", "b", "c"},
|
||||||
};
|
};
|
||||||
ASSERT_EQ(read_csv("a,b,c", CsvHeader::KEEP), expected);
|
ASSERT_EQ(read_csv("a,b,c", CsvHeader::KEEP), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(csv, single_line) {
|
TEST(read_csv, single_line) {
|
||||||
auto const expected = csv_type{
|
auto const expected = csv_type{
|
||||||
{"1", "2", "3"},
|
{"1", "2", "3"},
|
||||||
};
|
};
|
||||||
ASSERT_EQ(read_csv("a,b,c\n1,2,3"), expected);
|
ASSERT_EQ(read_csv("a,b,c\n1,2,3"), expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(csv, single_line_with_header) {
|
TEST(read_csv, single_line_with_header) {
|
||||||
auto const expected = csv_type{
|
auto const expected = csv_type{
|
||||||
{"a", "b", "c"},
|
{"a", "b", "c"},
|
||||||
{"1", "2", "3"},
|
{"1", "2", "3"},
|
||||||
|
|
Loading…
Reference in a new issue