mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Added file name validation.
This commit is contained in:
parent
d4a53f3f5b
commit
a797f98218
1 changed files with 4 additions and 2 deletions
|
@ -101,9 +101,11 @@ public abstract class RefactoringTestBase extends BaseTestCase {
|
|||
BufferedReader reader = new BufferedReader(new StringReader(contents.toString()));
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
String trimmedLine = line.trim();
|
||||
if (testFile == null) {
|
||||
testFile = new TestSourceFile(line.trim());
|
||||
} else if (isResultDelimiter(line.trim())) {
|
||||
assertTrue("Invalid file name \"" + trimmedLine + "\"", trimmedLine.matches("^(\\w+/)*\\w+\\.\\w+$"));
|
||||
testFile = new TestSourceFile(trimmedLine);
|
||||
} else if (isResultDelimiter(trimmedLine)) {
|
||||
expectedResult = true;
|
||||
} else if (expectedResult) {
|
||||
testFile.addLineToExpectedSource(line);
|
||||
|
|
Loading…
Add table
Reference in a new issue