Skip to content

Commit

Permalink
also verify error position for CLASS_MUST_BE_ABSTRACT
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Dec 29, 2023
1 parent ab8c3fb commit 5d39e36
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,20 +389,29 @@ public class OverrideValidationTest extends AbstractXtendTestCase {
}

@Test public void testClassMustBeAbstract_01() throws Exception {
XtendClass xtendClass = clazz("class Foo<S> implements Comparable<S> { }");
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT, "abstract", "not", "implement",
var source = "class Foo<S> implements Comparable<S> { }";
XtendClass xtendClass = clazz(source);
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT,
source.indexOf("Foo"), "Foo".length(),
"abstract", "not", "implement",
"compareTo(S)");
}

@Test public void testClassMustBeAbstract_02() throws Exception {
XtendClass xtendClass = clazz("class Foo<S> implements Comparable { }");
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT, "abstract", "not", "implement",
var source = "class Foo<S> implements Comparable { }";
XtendClass xtendClass = clazz(source);
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT,
source.indexOf("Foo"), "Foo".length(),
"abstract", "not", "implement",
"compareTo(Object)");
}

@Test public void testClassMustBeAbstract_03() throws Exception {
XtendClass xtendClass = clazz("class Foo implements Comparable<String> { }");
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT, "abstract", "not", "implement",
var source = "class Foo implements Comparable<String> { }";
XtendClass xtendClass = clazz(source);
helper.assertError(xtendClass, XTEND_CLASS, CLASS_MUST_BE_ABSTRACT,
source.indexOf("Foo"), "Foo".length(),
"abstract", "not", "implement",
"compareTo(String)");
}

Expand Down

0 comments on commit 5d39e36

Please sign in to comment.