Fix diff parsing and run unit tests

This commit is contained in:
qwerty287 2022-08-19 14:14:38 +02:00
parent a7d9918b67
commit e3a121e58a
No known key found for this signature in database
GPG key ID: E0464C650D9D25B2
2 changed files with 7 additions and 0 deletions

View file

@ -13,3 +13,8 @@ pipeline:
settings:
file_pattern: "*.java"
path: "app/"
test:
image: gradle:7.4.1
commands:
- gradle test

View file

@ -43,6 +43,8 @@ public class ParseDiff {
Matcher rmMatcher = rmPattern.matcher(raw);
Matcher addMatcher = addPattern.matcher(raw);
if(raw.startsWith("+")) add++;
else if(raw.startsWith("-")) rm++;
while(rmMatcher.find())
rm++;
while(addMatcher.find())