Skip to content

Commit

Permalink
Merge pull request #248 from JeffersonLab/AyanRoy16_issue_217_mangle_…
Browse files Browse the repository at this point in the history
…strings_with_whitespaces

Address issue #217: Test JParameterManager handling of strings containing whitespace
  • Loading branch information
nathanwbrei authored Oct 9, 2023
2 parents 32cae2e + f4d2002 commit 0eaed8e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/programs/tests/JParameterManagerTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,14 @@ TEST_CASE("JParameterManager_ArrayParams") {
}
}

TEST_CASE("JParameterManager_Issue217StringsWithWhitespace") {
JParameterManager jpm;
SECTION("Reading a array of strings") {
jpm.SetParameter("test", "( abs(fmod(tower_1, 24) - fmod(tower_2, 24)) + min( abs((sector_1 - sector_2) * (2 * 5) + (floor(tower_1 / 24) - floor(tower_2 / 24)) * 5 + fmod(tile_1, 5) - fmod(tile_2, 5)), (32 * 2 * 5) - abs((sector_1 - sector_2) * (2 * 5) + (floor(tower_1 / 24) - floor(tower_2 / 24)) * 5 + fmod(tile_1, 5) - fmod(tile_2, 5)) )) == 1");
std::string vals;
jpm.GetParameter<std::string>("test", vals);
REQUIRE(vals == "( abs(fmod(tower_1, 24) - fmod(tower_2, 24)) + min( abs((sector_1 - sector_2) * (2 * 5) + (floor(tower_1 / 24) - floor(tower_2 / 24)) * 5 + fmod(tile_1, 5) - fmod(tile_2, 5)), (32 * 2 * 5) - abs((sector_1 - sector_2) * (2 * 5) + (floor(tower_1 / 24) - floor(tower_2 / 24)) * 5 + fmod(tile_1, 5) - fmod(tile_2, 5)) )) == 1");
}
}


0 comments on commit 0eaed8e

Please sign in to comment.