Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and enable SuggestedFixRules tests #581

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ final class RefasterRulesTest {
/** The names of all Refaster rule groups defined in this module. */
private static final ImmutableSet<Class<?>> RULE_COLLECTIONS =
ImmutableSet.of(
AssertJRules.class,
AssertJBigDecimalRules.class,
AssertJBigIntegerRules.class,
AssertJBooleanRules.class,
Expand All @@ -25,11 +24,12 @@ final class RefasterRulesTest {
AssertJFloatRules.class,
AssertJIntegerRules.class,
AssertJLongRules.class,
AssertJNumberRules.class,
AssertJMapRules.class,
AssertJNumberRules.class,
AssertJObjectRules.class,
AssertJOptionalRules.class,
AssertJPrimitiveRules.class,
AssertJRules.class,
AssertJShortRules.class,
AssertJStringRules.class,
AssertJThrowingCallableRules.class,
Expand Down Expand Up @@ -65,6 +65,7 @@ final class RefasterRulesTest {
RxJava2AdapterRules.class,
StreamRules.class,
StringRules.class,
SuggestedFixRules.class,
TestNGToAssertJRules.class,
TimeRules.class,
WebClientRules.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package tech.picnic.errorprone.refasterrules;

import com.google.errorprone.fixes.SuggestedFix;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.Tree;
import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase;

final class SuggestFixRulesTest implements RefasterRuleCollectionTestCase {
final class SuggestedFixRulesTest implements RefasterRuleCollectionTestCase {
SuggestedFix testSuggestedFixDelete() {
return SuggestedFix.builder().delete(null).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
import com.sun.source.tree.Tree;
import tech.picnic.errorprone.refaster.test.RefasterRuleCollectionTestCase;

final class SuggestFixRulesTest implements RefasterRuleCollectionTestCase {
final class SuggestedFixRulesTest implements RefasterRuleCollectionTestCase {
SuggestedFix testSuggestedFixDelete() {
return SuggestedFix.delete(null);
}

SuggestedFix testSuggestedFixReplaceTree() {
return Suggestions.replace(null, "foo");
return SuggestedFix.replace(null, "foo");
}

SuggestedFix testSuggestedFixReplaceStartEnd() {
return Suggestions.replace(1, 2, "foo");
return SuggestedFix.replace(1, 2, "foo");
}

SuggestedFix testSuggestedFixReplaceTreeStartEnd() {
return Suggestions.replace(null, "foo", 1, 2);
return SuggestedFix.replace(null, "foo", 1, 2);
}

SuggestedFix testSuggestedFixSwap() {
return Suggestions.swap((Tree) null, (ExpressionTree) null);
return SuggestedFix.swap((Tree) null, (ExpressionTree) null);
}

SuggestedFix testSuggestedFixPrefixWith() {
return Suggestions.prefixWith(null, "foo");
return SuggestedFix.prefixWith(null, "foo");
}

SuggestedFix testSuggestedFixPostfixWith() {
return Suggestions.postfixWith(null, "foo");
return SuggestedFix.postfixWith(null, "foo");
}
}