use of org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileSection in project linuxtools by eclipse.
the class HeaderRecognitionTest method testGetComplexSectionName4.
@Test
public void testGetComplexSectionName4() {
// FIXME: check for rest of line when -p is implemented
// this should be an error case
String testText = "%post -n name -p";
String[] tokens = testText.split("\\s+");
SpecfileElement element;
newFile(testText);
element = parser.parseLine(testText, specfile, 0);
assertEquals(SpecfileSection.class, element.getClass());
SpecfileSection section = (SpecfileSection) element;
assertEquals(tokens[0].substring(1), section.getName());
assertEquals(tokens[2], section.getPackage().getPackageName());
}
use of org.eclipse.linuxtools.rpm.ui.editor.parser.SpecfileSection in project linuxtools by eclipse.
the class HeaderRecognitionTest method testGetComplexSectionName6.
@Test
public void testGetComplexSectionName6() {
String testText = "%post -p blah bleh";
// FIXME: check for rest of line when -p is implemented
// "blah bleh" should become the actual text of the section
String[] tokens = testText.split("\\s+");
SpecfileElement element;
newFile(testText);
element = parser.parseLine(testText, specfile, 0);
assertEquals(SpecfileSection.class, element.getClass());
SpecfileSection section = (SpecfileSection) element;
assertEquals(tokens[0].substring(1), section.getName());
assertNull(section.getPackage());
}
Aggregations