use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testCC.
@Test
public void testCC() throws Exception {
final TypeDeclaration decl = findType("CC.ceylon", "CC.C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals(QUAL + "CC.C", naming.makeTypeDeclarationName(decl, QUALIFIED));
assertEquals("com.redhat.ceylon.compiler.java.codegen.CC.C", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testfCC.
@Test
public void testfCC() throws Exception {
final TypeDeclaration decl = findType("fCC.ceylon", "fCC.CC.C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals("CC.C", naming.makeTypeDeclarationName(decl, QUALIFIED));
try {
CodegenUtil.getJavaNameOfDeclaration(decl);
fail();
} catch (IllegalArgumentException e) {
}
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testfII.
@Test
public void testfII() throws Exception {
final TypeDeclaration decl = findType("fII.ceylon", "fII.II.I");
Assert.assertEquals("fII$II$I_", naming.makeTypeDeclarationName(decl));
Assert.assertEquals("I$impl", naming.makeTypeDeclarationName(decl, COMPANION));
Assert.assertEquals(QUAL + "fII$II$I_", naming.makeTypeDeclarationName(decl, QUALIFIED));
Assert.assertEquals("II$impl.I$impl", naming.makeTypeDeclarationName(decl, COMPANION, QUALIFIED));
try {
CodegenUtil.getJavaNameOfDeclaration(decl);
fail();
} catch (IllegalArgumentException e) {
}
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testIC.
@Test
public void testIC() throws Exception {
final TypeDeclaration decl = findType("IC.ceylon", "IC.C");
Assert.assertEquals("C", naming.makeTypeDeclarationName(decl));
Assert.assertEquals(QUAL + "IC$impl.C", naming.makeTypeDeclarationName(decl, QUALIFIED));
assertEquals("com.redhat.ceylon.compiler.java.codegen.IC$impl.C", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.TypeDeclaration in project ceylon-compiler by ceylon.
the class NamingTests method testoI.
@Test
public void testoI() throws Exception {
final TypeDeclaration decl = findType("oI.ceylon", "oI.I");
Assert.assertEquals("oI$I_", naming.makeTypeDeclarationName(decl));
Assert.assertEquals("I$impl", naming.makeTypeDeclarationName(decl, COMPANION));
Assert.assertEquals(QUAL + "oI$I_", naming.makeTypeDeclarationName(decl, QUALIFIED));
Assert.assertEquals(QUAL + "oI_.I$impl", naming.makeTypeDeclarationName(decl, COMPANION, QUALIFIED));
assertEquals("com.redhat.ceylon.compiler.java.codegen.oI$I_", CodegenUtil.getJavaNameOfDeclaration(decl));
}
Aggregations