Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Mar 25, 2024
1 parent 943aaa1 commit c4b4619
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/main/java/fr/inria/coming/core/engine/files/FilePair.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public String getNextVersion() {
}

@Override
// TODO this should return a file
// because the convention on the "name" is unclear
// a file name? or a valid file path?
public String getNextName() {
return postName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,24 +489,31 @@ private void runnerMainPatterngeneric(String action, String entitytype, String e
public void assertResult(Set<String> commitsId, FinalResult finalResult) {
CommitFinalResult commitResult = (CommitFinalResult) finalResult;
System.out.println("FinalResults: \n" + finalResult);
Commit found = null;
for (Commit commit : commitResult.getAllResults().keySet()) {

PatternInstancesFromRevision patterns = (PatternInstancesFromRevision) commitResult.getAllResults()
.get(commit).getResultFromClass(PatternInstanceAnalyzer.class);
assertNotNull(patterns);

if (commitsId.contains(commit.getName())) {
found = commit;
assertTrue("Not changes at: " + commit.getName(), patterns.getInfoPerDiff().size() > 0);
System.out.println("Instance found: " + patterns.getInfoPerDiff());

for (PatternInstancesFromDiff instancesdiff : patterns.getInfoPerDiff()) {
assertTrue(instancesdiff.getInstances().size() > 0);
//
if (instancesdiff.getInstances().size() > 0) {
return;
}
}
throw new AssertionError("No instances found at: " + commit.getName() + " but expected");
} else {
// firsts commits, no changes, file introduction
// assertTrue(patterns.getInstances().isEmpty());
}

}
if (found == null) {
throw new AssertionError("No commit found with the expected instances");
}
}

Expand Down

0 comments on commit c4b4619

Please sign in to comment.