File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/com/dashjoin/jsonata Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .dashjoin .jsonata ;
2+
3+ import org .junit .jupiter .api .Assertions ;
4+ import org .junit .jupiter .api .Disabled ;
5+ import org .junit .jupiter .api .Test ;
6+
7+ public class ExceptionTest {
8+
9+ @ Disabled
10+ @ Test
11+ public void testError () {
12+ Jsonata expr = Jsonata .jsonata ("$error('message')" );
13+ try {
14+ expr .evaluate (null );
15+ Assertions .fail ();
16+ } catch (JException e ) {
17+ Assertions .assertEquals ("message" , e .getMessage ());
18+ }
19+ }
20+
21+ @ Test
22+ public void testDivZero () {
23+ Jsonata expr = Jsonata .jsonata ("1 / 0" );
24+ try {
25+ expr .evaluate (null );
26+ Assertions .fail ();
27+ } catch (JException e ) {
28+ Assertions .assertEquals ("Number out of range: \" Infinity\" " , e .getMessage ());
29+ }
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments