Skip to content

Commit

Permalink
test: Add consecutive lines scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jpedroh committed Dec 5, 2023
1 parent e82128c commit 6a575ab
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ fn it_works_on_arithmetic_expression() {
run_tool_on_scenario("arithmetic_expression")
}

#[test]
fn it_works_on_consecutive_lines() {
run_tool_on_scenario("consecutive_lines")
}

fn run_tool_on_scenario(scenario_name: &str) {
let mut cmd = Command::cargo_bin("generic-merge").unwrap();
cmd.arg(format!("-b=tests/samples/{}/base.java", scenario_name))
Expand Down
6 changes: 6 additions & 0 deletions bin/tests/samples/consecutive_lines/base.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class Test {
private void method() {
int a = 0;
int b = 0;
}
}
6 changes: 6 additions & 0 deletions bin/tests/samples/consecutive_lines/left.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class Test {
private void method() {
int a = 1;
int b = 0;
}
}
1 change: 1 addition & 0 deletions bin/tests/samples/consecutive_lines/merge.expected.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public class Test { private void method ( ) { int a = 1 ; int b = 1 ; } }
6 changes: 6 additions & 0 deletions bin/tests/samples/consecutive_lines/right.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class Test {
private void method() {
int a = 0;
int b = 1;
}
}

0 comments on commit 6a575ab

Please sign in to comment.