aboutsummaryrefslogtreecommitdiff
path: root/javaparser-testing/src/test/java/com/github/javaparser/ast/body/ConstructorDeclarationTest.java
blob: 34d3b625461231056f635df401977a5e17856d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.github.javaparser.ast.body;

import com.github.javaparser.JavaParser;
import com.github.javaparser.ParseResult;
import org.junit.Test;

import static com.github.javaparser.ParseStart.CLASS_BODY;
import static com.github.javaparser.Providers.provider;
import static com.github.javaparser.utils.TestUtils.assertProblems;
import static com.github.javaparser.utils.Utils.EOL;
import static org.junit.Assert.assertEquals;

public class ConstructorDeclarationTest {
    @Test
    public void acceptsSuper() {
        ConstructorDeclaration cons = new ConstructorDeclaration("Cons");
        cons.createBody().addStatement("super();");

        assertEquals(String.format("public Cons() {%1$s" +
                "    super();%1$s" +
                "}", EOL), cons.toString());
    }
}