mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
Removed the preproc.issue package by relocating supporting classes for PreprocessIssueMessageSimplifier and PdeIssueEmitter as inner classes. This assists with https://github.com/processing/processing4/issues/10.
45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package processing.mode.java.preproc;
|
|
|
|
import org.junit.Assert;
|
|
import org.junit.Before;
|
|
import org.junit.Test;
|
|
import processing.mode.java.preproc.PdeIssueEmitter;
|
|
import processing.mode.java.preproc.PreprocessIssueMessageSimplifier;
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
public class MissingMethodNameMessageSimplifierStrategyTest {
|
|
|
|
private PreprocessIssueMessageSimplifier.PreprocIssueMessageSimplifierStrategy strategy;
|
|
|
|
@Before
|
|
public void setup() {
|
|
strategy = PreprocessIssueMessageSimplifier.get().createMethodMissingNameStrategy();
|
|
}
|
|
|
|
@Test
|
|
public void testPresent() {
|
|
Optional<PdeIssueEmitter.IssueMessageSimplification> msg = strategy.simplify("void (int x) \n{");
|
|
Assert.assertTrue(msg.isPresent());
|
|
}
|
|
|
|
@Test
|
|
public void testPresentNoSpace() {
|
|
Optional<PdeIssueEmitter.IssueMessageSimplification> msg = strategy.simplify("test(int x) \n{");
|
|
Assert.assertTrue(msg.isPresent());
|
|
}
|
|
|
|
@Test
|
|
public void testPresentUnderscore() {
|
|
Optional<PdeIssueEmitter.IssueMessageSimplification> msg = strategy.simplify("void (int x_y) \n{");
|
|
Assert.assertTrue(msg.isPresent());
|
|
}
|
|
|
|
@Test
|
|
public void testNotPresent() {
|
|
Optional<PdeIssueEmitter.IssueMessageSimplification> msg = strategy.simplify("int x = y");
|
|
Assert.assertTrue(msg.isEmpty());
|
|
}
|
|
|
|
} |