use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testTuple3OrMoreAbbrev.
@Test
public void testTuple3OrMoreAbbrev() {
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());
}
use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testHomoTuple2.
@Test
public void testHomoTuple2() {
Type type = new TypeParser(MockLoader.instance).decodeType("a[2]", 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[2]", type.asString());
Assert.assertNull(type.getQualifyingType());
}
use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testTuple1Abbrev.
@Test
public void testTuple1Abbrev() {
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 Class);
Assert.assertEquals("ceylon.language::Tuple", 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 testEmptyAbbrev.
@Test
public void testEmptyAbbrev() {
Type type = new TypeParser(MockLoader.instance).decodeType("[]", null, mockDefaultModule, mockPkgUnit);
Assert.assertNotNull(type);
TypeDeclaration declaration = type.getDeclaration();
Assert.assertNotNull(declaration);
Assert.assertTrue(declaration instanceof Interface);
Assert.assertEquals("ceylon.language::Empty", declaration.getQualifiedNameString());
Assert.assertNull(type.getQualifyingType());
}
use of com.redhat.ceylon.model.loader.TypeParser in project ceylon-compiler by ceylon.
the class TypeParserTests method testTuple1OrMoreAbbrev.
@Test
public void testTuple1OrMoreAbbrev() {
Type type = new TypeParser(MockLoader.instance).decodeType("[a,b*]", 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*]", type.asString());
Assert.assertNull(type.getQualifyingType());
}
Aggregations