mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 03:41:15 +01:00
Refactor out preproc.issue.
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.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user