Skip to content
Snippets Groups Projects
Commit 3839133a authored by Bienchen's avatar Bienchen
Browse files

Testing reading star formatted files with leading whitespaces

parent ee20bb97
No related branches found
No related tags found
No related merge requests found
......@@ -287,6 +287,19 @@ BOOST_AUTO_TEST_CASE(star_data_item)
BOOST_TEST_MESSAGE(" done.");
}
BOOST_AUTO_TEST_CASE(star_ws_data_item)
{
BOOST_TEST_MESSAGE(" Running star_ws_data_item tests...");
std::ifstream s("testfiles/ws-data-item.cif");
DataItemTestParser star_p(s);
BOOST_CHECK_NO_THROW(star_p.Parse());
BOOST_CHECK_EQUAL(star_p.s1, "a");
BOOST_CHECK_EQUAL(star_p.s2, "a b c");
BOOST_CHECK_EQUAL(star_p.s3, "a\n b\nc");
BOOST_CHECK_EQUAL(star_p.s4, "a'b");
BOOST_TEST_MESSAGE(" done.");
}
BOOST_AUTO_TEST_CASE(format_diag_stream)
{
BOOST_TEST_MESSAGE(" Running format_diag_stream tests...");
......@@ -359,6 +372,21 @@ BOOST_AUTO_TEST_CASE(star_loop)
BOOST_TEST_MESSAGE(" done.");
}
BOOST_AUTO_TEST_CASE(star_ws_loop)
{
BOOST_TEST_MESSAGE(" Running star_ws_loop tests...");
std::ifstream s("testfiles/ws_loop.cif");
LoopTestParser star_p(s);
star_p.Parse();
BOOST_CHECK_EQUAL(star_p.lines[0][0], "1");
BOOST_CHECK_EQUAL(star_p.lines[0][1], "2");
BOOST_CHECK_EQUAL(star_p.lines[0][2], "3");
BOOST_CHECK_EQUAL(star_p.lines[1][0], "a");
BOOST_CHECK_EQUAL(star_p.lines[1][1], "b");
BOOST_CHECK_EQUAL(star_p.lines[1][2], "c");
BOOST_TEST_MESSAGE(" done.");
}
BOOST_AUTO_TEST_CASE(star_items_as_row)
{
BOOST_TEST_MESSAGE(" Running star_items_as_row tests...");
......
# Intentinally comment with whitespaces, should not throw error
data_data-item
_data-item.s1 a
_data-item.s2 'a b c'
_data-item.s3
;
a
b
c
;
_data-item.s4 'a'b'
data_loop
loop_
_loop.s1
_loop.s2
_loop.s3
1 2 3
# comment with leading whitespaces should be skipped
a b c
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment