diff options
Diffstat (limited to 'test/test_csv.cpp')
-rw-r--r-- | test/test_csv.cpp | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/test/test_csv.cpp b/test/test_csv.cpp index cb93a32..65c02ef 100644 --- a/test/test_csv.cpp +++ b/test/test_csv.cpp @@ -138,6 +138,79 @@ TEST(FudCsv, ParseCsvFromFilename) } } +TEST(FudCsv, ParseNuclides) +{ + Vector<StringView> expectedHeaders{}; + auto pushExpected = [&](StringView item) { + auto pushStatus = expectedHeaders.pushBack(StringView{u8"z"}); + fudAssert(pushStatus == FudStatus::Success); + }; + pushExpected(StringView{u8"z"}); + pushExpected(StringView{u8"n"}); + pushExpected(StringView{u8"symbol"}); + pushExpected(StringView{u8"radius"}); + pushExpected(StringView{u8"unc_r"}); + pushExpected(StringView{u8"abundance"}); + pushExpected(StringView{u8"unc_a"}); + pushExpected(StringView{u8"energy_shift"}); + pushExpected(StringView{u8"energy"}); + pushExpected(StringView{u8"unc_e"}); + pushExpected(StringView{u8"ripl_shift"}); + pushExpected(StringView{u8"jp"}); + pushExpected(StringView{u8"half_life"}); + pushExpected(StringView{u8"operator_hl"}); + pushExpected(StringView{u8"unc_hl"}); + pushExpected(StringView{u8"unit_hl"}); + pushExpected(StringView{u8"half_life_sec"}); + pushExpected(StringView{u8"unc_hls"}); + pushExpected(StringView{u8"decay_1"}); + pushExpected(StringView{u8"decay_1_%"}); + pushExpected(StringView{u8"unc_1"}); + pushExpected(StringView{u8"decay_2"}); + pushExpected(StringView{u8"decay_2_%"}); + pushExpected(StringView{u8"unc_2"}); + pushExpected(StringView{u8"decay_3"}); + pushExpected(StringView{u8"decay_3_%"}); + pushExpected(StringView{u8"unc_3"}); + pushExpected(StringView{u8"isospin"}); + pushExpected(StringView{u8"magnetic_dipole"}); + pushExpected(StringView{u8"unc_md"}); + pushExpected(StringView{u8"electric_quadrupole"}); + pushExpected(StringView{u8"unc_eq"}); + pushExpected(StringView{u8"qbm"}); + pushExpected(StringView{u8"unc_qb"}); + pushExpected(StringView{u8"qbm_n"}); + pushExpected(StringView{u8"unc_qbmn"}); + pushExpected(StringView{u8"qa"}); + pushExpected(StringView{u8"unc_qa"}); + pushExpected(StringView{u8"qec"}); + pushExpected(StringView{u8"unc_qec"}); + pushExpected(StringView{u8"sn"}); + pushExpected(StringView{u8"unc_sn"}); + pushExpected(StringView{u8"sp"}); + pushExpected(StringView{u8"unc_sp"}); + pushExpected(StringView{u8"binding"}); + pushExpected(StringView{u8"unc_ba"}); + pushExpected(StringView{u8"atomic_mass"}); + pushExpected(StringView{u8"unc_am"}); + pushExpected(StringView{u8"massexcess"}); + pushExpected(StringView{u8"unc_me"}); + pushExpected(StringView{u8"me_systematics"}); + pushExpected(StringView{u8"discovery"}); + pushExpected(StringView{u8"ENSDFpublicationcut-off"}); + pushExpected(StringView{u8"ENSDFauthors"}); + pushExpected(StringView{u8"Extraction_date"}); + + StringView nuclidesFilename{u8"test/nuclides.csv"}; + Csv csv{Csv::makeDefault()}; + auto parseStatus = Csv::parseFromFilenameUnbuffered(csv, nuclidesFilename); + if (parseStatus != FudStatus::Success) { + debugPrint(u8"Error parsing file: {}\n", FudStatusToString(parseStatus)); + } + ASSERT_EQ(parseStatus, FudStatus::Success); + +} + } // namespace fud //NOLINTEND(readability-magic-numbers) |