Skip to content

Commit a1f1f58

Browse files
Logging correction and fail-testing
1 parent 70de591 commit a1f1f58

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

tests/test_libvcell.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ def test_vcell_infix_to_python_infix() -> None:
9090
assert success is True
9191
assert msg == "Success"
9292
assert value == expectedResult
93+
94+
95+
def test_bad_vcell_infix() -> None:
96+
vcellInfix = "id_1 / + / /- cos(/ / /) id_2"
97+
success, msg, value = vcell_infix_to_python_infix(vcellInfix)
98+
assert success is False

vcell-native/src/main/java/org/vcell/libvcell/Entrypoints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public static CCharPointer entrypoint_vcellInfixToPythonInfix(
236236
}
237237
// return result as a json string
238238
String json = returnValue.toJson();
239-
logger.info("Returning from vcellToVcml: " + json);
239+
logger.info("Returning from vcellInfixToPythonInfix: " + json);
240240
return createString(json);
241241
}
242242

vcell-native/src/test/java/org/vcell/libvcell/ModelEntrypointsTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,17 @@ public void test_get_python_infix(){
7474
assert expected.equals(pythonInfix);
7575
}
7676

77+
@Test
78+
public void test_bad_python_infix_attempt(){
79+
String vcellInfix = "id_1 / + / /- cos(/ / /) id_2";
80+
String pythonInfix;
81+
try {
82+
pythonInfix = get_python_infix(vcellInfix);
83+
} catch (ExpressionException e) {
84+
return; // this is what we'd expect
85+
}
86+
System.err.println("test_bad_python_infix_attempt did not throw an exception");
87+
assert(false);
88+
}
89+
7790
}

0 commit comments

Comments
 (0)