Skip to content

Commit

Permalink
Add to data space delimiting test #147
Browse files Browse the repository at this point in the history
  • Loading branch information
riftEmber committed Oct 13, 2021
1 parent 1317173 commit b76267a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/computation/computation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ TEST_F(ComputationTest, DelimitDataSpacesTest) {
comp->addDataSpace("sd", "int");
comp->addDataSpace("x", "int");
comp->addDataSpace("z", "string");
comp->addDataSpace("N", "int");

EXPECT_EQ("int $asdf$ = 3;", comp->delimitDataSpacesInString("int asdf = 3;"));
EXPECT_EQ("int $asdf$ = 3*$x$;", comp->delimitDataSpacesInString("int asdf = 3*x;"));
Expand All @@ -1556,6 +1557,8 @@ TEST_F(ComputationTest, DelimitDataSpacesTest) {
}", comp->delimitDataSpacesInString("if (z == \"\\\"asdf\") {\
asdf = 5;\
}"));
EXPECT_EQ("{[i,j]: 0 < i < j && 0 < j < 10}", comp->delimitDataSpacesInString("{[i,j]: 0 < i < j && 0 < j < 10}"));
EXPECT_EQ("{[i]: 0 < i < $N$}", comp->delimitDataSpacesInString("{[i]: 0 < i < N}"));

delete comp;
}

0 comments on commit b76267a

Please sign in to comment.