DefaultJavadocScanner scanner = string("double");
IrDocType type = JavadocBlockParserUtil.fetchType(scanner, null);
assertNotNull(type);
assertEquals(IrDocElementKind.BASIC_TYPE, type.getKind());
IrDocBasicType elem = (IrDocBasicType) type;
assertEquals(IrBasicTypeKind.DOUBLE, elem.getTypeKind());
assertSameLocation(0, "double".length(), elem.getLocation());
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("float[]");
IrDocType type = JavadocBlockParserUtil.fetchType(scanner, null);
assertNotNull(type);
assertEquals(IrDocElementKind.ARRAY_TYPE, type.getKind());
IrDocArrayType array = (IrDocArrayType) type;
assertSameLocation(0, "float[]".length(), array.getLocation());
IrDocBasicType elem = (IrDocBasicType) array.getComponentType();
assertEquals(IrBasicTypeKind.FLOAT, elem.getTypeKind());
assertSameLocation(0, "float".length(), elem.getLocation());
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("char[][]");
IrDocType type = JavadocBlockParserUtil.fetchType(scanner, null);
assertNotNull(type);
assertEquals(IrDocElementKind.ARRAY_TYPE, type.getKind());
IrDocArrayType array = (IrDocArrayType) type;
assertSameLocation(0, "char[][]".length(), array.getLocation());
IrDocType component = array.getComponentType();
assertEquals(IrDocElementKind.ARRAY_TYPE, component.getKind());
IrDocArrayType array2 = (IrDocArrayType) component;
assertSameLocation(0, "char[]".length(), array2.getLocation());
IrDocBasicType elem = (IrDocBasicType) array2.getComponentType();
assertEquals(IrBasicTypeKind.CHAR, elem.getTypeKind());
assertSameLocation(0, "char".length(), elem.getLocation());
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("java.lang.String");
IrDocType type = JavadocBlockParserUtil.fetchType(scanner, null);
assertNotNull(type);
assertEquals(IrDocElementKind.NAMED_TYPE, type.getKind());
IrDocNamedType elem = (IrDocNamedType) type;
assertEquals("java.lang.String", elem.getName().asString());
assertSameLocation(0, "java.lang.String".length(), elem.getLocation());
assertEquals(EOF, scanner.lookahead(0).getKind());
}
{
DefaultJavadocScanner scanner = string("java.lang.String[]");
IrDocType type = JavadocBlockParserUtil.fetchType(scanner, null);
assertNotNull(type);
assertEquals(IrDocElementKind.ARRAY_TYPE, type.getKind());
IrDocArrayType array = (IrDocArrayType) type;
assertSameLocation(0, "java.lang.String[]".length(), array.getLocation());
IrDocNamedType elem = (IrDocNamedType) array.getComponentType();
assertEquals("java.lang.String", elem.getName().asString());
assertSameLocation(0, "java.lang.String".length(), elem.getLocation());
assertEquals(EOF, scanner.lookahead(0).getKind());
}
}