Search in sources :

Example 1 with Set

use of de.prob.translator.types.Set in project probparsers by bendisposto.

the class TestTranslator method testTranslateRecordWithSetValues.

@Test
public void testTranslateRecordWithSetValues() throws Exception {
    Record o = (Record) Translator.translate("rec(key1:{1,2,3}, key2:{a,b})");
    Set a = (Set) o.get("key1");
    assertTrue(a.contains(Number.build(1)));
}
Also used : Set(de.prob.translator.types.Set) Record(de.prob.translator.types.Record) Test(org.junit.Test)

Example 2 with Set

use of de.prob.translator.types.Set in project probparsers by bendisposto.

the class TestTranslator method testTranslateEmptySet.

@Test
public void testTranslateEmptySet() throws Exception {
    Set o = (Set) Translator.translate("{}");
    assertTrue(o.size() == 0);
}
Also used : Set(de.prob.translator.types.Set) Test(org.junit.Test)

Example 3 with Set

use of de.prob.translator.types.Set in project probparsers by bendisposto.

the class TestTranslator method testTranslateIntSet.

@Test
public void testTranslateIntSet() throws Exception {
    Set o = (Set) Translator.translate("{5,6,7}");
    assertTrue(o.size() == 3);
    assertFalse(o.contains(Number.build("8")));
}
Also used : Set(de.prob.translator.types.Set) Test(org.junit.Test)

Aggregations

Set (de.prob.translator.types.Set)3 Test (org.junit.Test)3 Record (de.prob.translator.types.Record)1