Skip to content

Commit

Permalink
Fix switch js, add black key (#15680)
Browse files Browse the repository at this point in the history
Co-authored-by: fuchanghai <changhaifu@apache.org>
Co-authored-by: Eric Gao <ericgao.apache@gmail.com>
  • Loading branch information
3 people committed Mar 18, 2024
1 parent faa794c commit 4a255fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Expand Up @@ -50,6 +50,10 @@ public class SwitchTaskUtils {
"eval",
"function",
"import",
".",
"()",
"[",
"]",
"\\\\");

static {
Expand Down
Expand Up @@ -65,5 +65,15 @@ public void testIllegalCondition() {
SwitchTaskUtils.generateContentWithTaskParams(contentWithUnicode, globalParams, varParams);
});

String contentWithSpecify1 = "cmd.abc";
Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> {
SwitchTaskUtils.generateContentWithTaskParams(contentWithSpecify1, globalParams, varParams);
});

String contentWithSpecify2 = "cmd()";
Assertions.assertThrowsExactly(IllegalArgumentException.class, () -> {
SwitchTaskUtils.generateContentWithTaskParams(contentWithSpecify2, globalParams, varParams);
});

}
}

0 comments on commit 4a255fd

Please sign in to comment.