use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testSequentialAbbrev.
@Test
public void testSequentialAbbrev() {
Type type = new TypeParser(MockLoader.instance).decodeType("[a*]", null, mockDefaultModule, mockPkgUnit);
Assert.assertNotNull(type);
TypeDeclaration declaration = type.getDeclaration();
Assert.assertNotNull(declaration);
Assert.assertTrue(declaration instanceof Interface);
Assert.assertEquals("ceylon.language::Sequential", declaration.getQualifiedNameString());
Assert.assertEquals("a[]", type.asString());
Assert.assertNull(type.getQualifyingType());
}
use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testTuple2OrMoreAbbrev2.
@Test
public void testTuple2OrMoreAbbrev2() {
Type type = new TypeParser(MockLoader.instance).decodeType("[a,b,c*]", null, mockDefaultModule, mockPkgUnit);
Assert.assertNotNull(type);
TypeDeclaration declaration = type.getDeclaration();
Assert.assertNotNull(declaration);
Assert.assertTrue(declaration instanceof Class);
Assert.assertEquals("ceylon.language::Tuple", declaration.getQualifiedNameString());
Assert.assertEquals("[a, b, c*]", type.asString());
Assert.assertNull(type.getQualifyingType());
}
Aggregations