Skip to content
Snippets Groups Projects
Commit 0ca4c92d authored by Bienchen's avatar Bienchen
Browse files

Solved BZDNG-282 by adding a new case in ParseLoop(). (Just checking for lines starting with a '_')

parent 8a366788
Branches
Tags
No related merge requests found
...@@ -171,6 +171,8 @@ void StarParser::ParseLoop() ...@@ -171,6 +171,8 @@ void StarParser::ParseLoop()
if (StringRef("loop_", 5)==tline) { if (StringRef("loop_", 5)==tline) {
return; return;
} }
case '_':
return;
default: default:
if (process_rows) { if (process_rows) {
int before=columns.size(); int before=columns.size();
...@@ -270,7 +272,7 @@ void StarParser::ParseData() ...@@ -270,7 +272,7 @@ void StarParser::ParseData()
if (tline.empty()) { if (tline.empty()) {
this->ConsumeLine(); this->ConsumeLine();
continue; continue;
} }
switch (tline[0]) { switch (tline[0]) {
case '_': case '_':
if (skip) { if (skip) {
......
...@@ -134,9 +134,10 @@ BOOST_AUTO_TEST_CASE(star_split3) ...@@ -134,9 +134,10 @@ BOOST_AUTO_TEST_CASE(star_split3)
BOOST_REQUIRE(parts.size()==1); BOOST_REQUIRE(parts.size()==1);
BOOST_CHECK_EQUAL(parts[0], StringRef("1 2", 3)); BOOST_CHECK_EQUAL(parts[0], StringRef("1 2", 3));
} }
BOOST_AUTO_TEST_CASE(star_data_item) BOOST_AUTO_TEST_CASE(star_data_item)
{ {
BOOST_MESSAGE(" Running star_data_item tests...");
std::ifstream s("testfiles/data-item.cif"); std::ifstream s("testfiles/data-item.cif");
DataItemTestParser star_p(s); DataItemTestParser star_p(s);
star_p.Parse(); star_p.Parse();
......
data_data-item data_data-item
# this file covers BZDNG-282
loop_
_loop.s1
_loop.s2
_loop.s3
_loop.s4
1 2 3 4
_data-item.s1 a _data-item.s1 a
_data-item.s2 'a b c' _data-item.s2 'a b c'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment