Skip to content

Commit

Permalink
feat: returns an empty list if the given test method does not contain…
Browse files Browse the repository at this point in the history
… any literals
  • Loading branch information
danglotb committed Jan 25, 2018
1 parent a26a84f commit 41afc5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/fr/inria/stamp/Ex2Amplifier.java
Expand Up @@ -18,6 +18,7 @@
import spoon.reflect.visitor.filter.TypeFilter;

import java.io.File;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -37,6 +38,9 @@ public Ex2Amplifier(InputConfiguration configuration) {

@Override
public List<CtMethod> apply(CtMethod ctMethod) {
if (ctMethod.getElements(new TypeFilter<CtLiteral>(CtLiteral.class)).isEmpty()) {
return Collections.emptyList();
}
final CtMethod<?> mainMethodFromTestMethod =
MainGenerator.generateMainMethodFromTestMethod(ctMethod);
final CtClass testClass = ctMethod.getParent(CtClass.class);
Expand Down

0 comments on commit 41afc5d

Please sign in to comment.