Skip to content

Commit

Permalink
Unit tests for js engine prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
abpai94 committed Sep 18, 2024
1 parent 88b83d4 commit 2c11add
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/test/java/org/lsc/utils/ScriptingEvaluatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,39 @@ public void testBoolean() throws LscServiceException {
boolean booleanOutput = ScriptingEvaluator.evalToBoolean(task, expression, new HashMap<>());
assertTrue(booleanOutput);
}

@Test
public void testJSPrefix1() throws LscServiceException {
String expression = "\njs:true";
boolean booleanOutput = ScriptingEvaluator.evalToBoolean(task, expression, new HashMap<>());
assertTrue(booleanOutput);
}

@Test
public void testJSPrefix2() throws LscServiceException {
String expression = "\njs:\ntrue";
boolean booleanOutput = ScriptingEvaluator.evalToBoolean(task, expression, new HashMap<>());
assertTrue(booleanOutput);
}

@Test
public void testJSPrefix3() throws LscServiceException {
String expression = "\njs:test=\"js\"";
String stringOutput = ScriptingEvaluator.evalToString(task, expression, new HashMap<>());
assertEquals("js", stringOutput);
}

@Test
public void testJSPrefix4() throws LscServiceException {
String expression = "\njs:\ntest=\"js\"";
String stringOutput = ScriptingEvaluator.evalToString(task, expression, new HashMap<>());
assertEquals("js", stringOutput);
}

@Test
public void testJSPrefix5() throws LscServiceException {
String expression = "\n\njs:\n\ntest=\"js\"";
String stringOutput = ScriptingEvaluator.evalToString(task, expression, new HashMap<>());
assertEquals("js", stringOutput);
}
}

0 comments on commit 2c11add

Please sign in to comment.