[ 
https://issues.apache.org/jira/browse/JEXL-282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723895#comment-16723895
 ] 

Henri Biestro edited comment on JEXL-282 at 12/18/18 10:17 AM:
---------------------------------------------------------------

Fixed grammar and test
https://github.com/apache/commons-jexl/commit/3b4a48485e691618d79b15c0e18190b06b1e2a7f
revision   : 3b4a48485e691618d79b15c0e18190b06b1e2a7f


was (Author: henrib):
Fixed grammar and test
revision   : 3b4a48485e691618d79b15c0e18190b06b1e2a7f

> Pragmas with antish names are broken
> ------------------------------------
>
>                 Key: JEXL-282
>                 URL: https://issues.apache.org/jira/browse/JEXL-282
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> The test cases in {{PragmaTest.java}} are now silently swallowing parsing 
> exceptions of tests with antish pragma names. In fact we should report a test 
> error if there is any exception caught during test run.
> {code:java}
>     @Test
>     public void testPragmas() throws Exception {
>         JexlContext jc = new MapContext();
>         try {
>             JexlScript script = JEXL.createScript("#pragma one 1\n#pragma 
> the.very.hard 'truth'\n2;");
>             Assert.assertTrue(script != null);
>             Map<String, Object> pragmas = script.getPragmas();
>             Assert.assertEquals(2, pragmas.size());
>             Assert.assertEquals(1, pragmas.get("one"));
>             Assert.assertEquals("truth", pragmas.get("the.very.hard"));
>         } catch (JexlException xjexl) {
>             String s = xjexl.toString();
>             /* We need to add this to the test */ 
>             Assert.fail("Should not fail with: " + s);
>         }
>     }
> {code}
> As for the problem itself, now a jexl script will not parse correctly with 
> pragmas specifying antish name, like the example specified in the 
> documentation:
> {code}
> #pragma execution.option 42
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to