Skip to content

Commit

Permalink
test: Verify that patch headers are printed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
lyxell committed Jul 9, 2021
1 parent e7ea7a0 commit 5bca9e5
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 12 deletions.
4 changes: 3 additions & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ logifix_cli="$1"

for f in $(find $BASEDIR/../src -iname '*.java'); do
echo "$f"
diff <("$1" --patch --accept-all "$f" | tail -n +2) <(tail -n +2 $f.diff)
cd $(dirname $f)
diff <($logifix_cli --patch --accept-all "$(basename $f)") "$(basename $f).diff"
cd -
done
2 changes: 1 addition & 1 deletion src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ int main(int argc, char** argv) {
count++;
int progress = int((double(count) / double(options.files.size())) * 40);
int progress_full = 40;
fmt::print("\r[{2:=^{0}}{2: ^{1}}] {3}/{4}", progress, progress_full - progress, "", count, options.files.size());
fmt::print(stderr, "\r[{2:=^{0}}{2: ^{1}}] {3}/{4}", progress, progress_full - progress, "", count, options.files.size());
});

//logifix::print_performance_metrics();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/2159_fix_silly_equality_checks/Test.java b/2159_fix_silly_equality_checks/Test.java
diff --git a/Test.java b/Test.java
@@ -1,5 +1,5 @@
class Test {
void test(Object x) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/../tests/local/2095_close_resources/Test.java b/../tests/local/2095_close_resources/Test.java
diff --git a/Test.java b/Test.java
@@ -5,11 +5,9 @@ import java.util.Arrays;

public class Test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/../src/rules/avoid_raw_types/tests/Test.java b/../src/rules/avoid_raw_types/tests/Test.java
diff --git a/TestFieldDeclaration.java b/TestFieldDeclaration.java
@@ -2,5 +2,5 @@ import java.util.Deque;
import java.util.ArrayDeque;

Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_empty_finally_blocks/tests/Test.java.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -10,8 +10,6 @@ public class Test {
System.out.println(Arrays.toString(bytes));
} catch (IOException e) {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_empty_if_statements/tests/Test.java.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -1,13 +1,8 @@
public class Test {
public void test(boolean x, boolean y, boolean z, boolean w) {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_empty_nested_blocks/tests/Test.java.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -2,8 +2,8 @@ public class Test {
public static void main(String[] args) {
if (true) {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_empty_try_blocks/tests/Test.java.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -1,9 +1,4 @@
public class Test {
void test() {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/remove_unused_imports/tests/Test.java.diff
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -1,4 +1,3 @@
-import java.util.ArrayList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
diff --git a/tests/Test.java b/tests/Test.java
diff --git a/Test.java b/Test.java
@@ -5,12 +5,7 @@ public class Test {
Map<String, Integer> myMap;

Expand Down

0 comments on commit 5bca9e5

Please sign in to comment.