Skip to content

Commit

Permalink
Adding test case for issue 217: Mangling strings with whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
AyanRoy16 committed Oct 4, 2023
1 parent 32cae2e commit b7f485b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/programs/tests/JParameterManagerTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,17 @@ TEST_CASE("JParameterManager_ArrayParams") {
}
}

TEST_CASE("Jparameter: Issue-217: Mangling strings with whitespaces") {
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");
//REQUIRE(vals[1] == "simple");
// REQUIRE(vals[2] == "whitespace in middle");
// REQUIRE(vals[3] == " also with whitespace padding ");
}
}


0 comments on commit b7f485b

Please sign in to comment.