Skip to content

Commit

Permalink
Input fields - Expression to generate options, does not "know"
Browse files Browse the repository at this point in the history
variables #371
  • Loading branch information
aeberhart committed Jun 19, 2024
1 parent 2a1c7ef commit 071dabf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/com/dashjoin/jsonata/ArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import static java.util.Arrays.asList;
import static java.util.Map.of;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

public class ArrayTest {
Expand All @@ -16,4 +19,11 @@ public void testArray() {
var res2 = expr2.evaluate(of("key", asList(of("x", "y"), of("a", "b"))));
assertEquals(res1, res2);
}

@Disabled
@Test
public void filterTest() {
Jsonata expr = jsonata("($arr := [{'x':1}, {'x':2}];$arr[x=$number(variable.field)])");
Assertions.assertNotNull(expr.evaluate(Map.of("variable", Map.of("field", "1"))));
}
}

0 comments on commit 071dabf

Please sign in to comment.