コード例 #1
0
 @Test
 public void testArray() {
   assertEquals(
       Arrays.asList(MetasyntacticVariable.values()),
       therianContext.eval(
           Convert.to(LIST_OF_MV_TYPE, Positions.readOnly(MetasyntacticVariable.values()))));
   assertEquals(
       Arrays.asList(),
       therianContext.eval(
           Convert.to(LIST_OF_MV_TYPE, Positions.readOnly(new MetasyntacticVariable[0]))));
 }
コード例 #2
0
 @Test
 public void testSingleton() {
   assertEquals(
       Collections.singletonList(MetasyntacticVariable.FOO),
       therianContext.eval(
           Convert.to(LIST_OF_MV_TYPE, Positions.readOnly(MetasyntacticVariable.FOO))));
 }
コード例 #3
0
 @Test
 public void testPrimitiveArray() {
   final int[] beast = {6, 6, 6};
   assertEquals(
       Arrays.asList(ArrayUtils.toObject(beast)),
       therianContext.eval(
           Convert.to(new TypeLiteral<List<Integer>>() {}, Positions.readOnly(beast))));
 }