tests: add comment merge scenarios to the corpus
Five scenarios pin the comments-as-nodes behavior end-to-end: a
comment edit merging with a code edit (rust and java), concurrent
distinct comment edits conflicting, a comment edit under a deletion
conflicting, and the mergiraf probe where both branches append a
different comment to a use list.

Assisted-by: Claude Fable 5 via Claude Code
change yvrnnzlxtursyqkrttsxuuqyyzokzymx
commit 1bbe4b1843b47b09626231a05a044d983179b46a
author Alpha Chen <alpha@kejadlen.dev>
date
parent vkmppsnp
diff --git a/tests/corpus/scenarios/comment-delete-edit/A.rs b/tests/corpus/scenarios/comment-delete-edit/A.rs
new file mode 100644
index 0000000..ca05282
--- /dev/null
+++ b/tests/corpus/scenarios/comment-delete-edit/A.rs
@@ -0,0 +1 @@
+fn a() {}
diff --git a/tests/corpus/scenarios/comment-delete-edit/B.rs b/tests/corpus/scenarios/comment-delete-edit/B.rs
new file mode 100644
index 0000000..0b60529
--- /dev/null
+++ b/tests/corpus/scenarios/comment-delete-edit/B.rs
@@ -0,0 +1,4 @@
+fn a() {}
+
+// all about b
+fn b() {}
diff --git a/tests/corpus/scenarios/comment-delete-edit/O.rs b/tests/corpus/scenarios/comment-delete-edit/O.rs
new file mode 100644
index 0000000..d34a321
--- /dev/null
+++ b/tests/corpus/scenarios/comment-delete-edit/O.rs
@@ -0,0 +1,4 @@
+fn a() {}
+
+// about b
+fn b() {}
diff --git a/tests/corpus/scenarios/comment-delete-edit/expected.CONFLICT b/tests/corpus/scenarios/comment-delete-edit/expected.CONFLICT
new file mode 100644
index 0000000..7031ba9
--- /dev/null
+++ b/tests/corpus/scenarios/comment-delete-edit/expected.CONFLICT
@@ -0,0 +1 @@
+relabel-delete
diff --git a/tests/corpus/scenarios/comment-edit-conflict/A.rs b/tests/corpus/scenarios/comment-edit-conflict/A.rs
new file mode 100644
index 0000000..322972f
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-conflict/A.rs
@@ -0,0 +1,2 @@
+// v2
+fn f() {}
diff --git a/tests/corpus/scenarios/comment-edit-conflict/B.rs b/tests/corpus/scenarios/comment-edit-conflict/B.rs
new file mode 100644
index 0000000..6fe6040
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-conflict/B.rs
@@ -0,0 +1,2 @@
+// v3
+fn f() {}
diff --git a/tests/corpus/scenarios/comment-edit-conflict/O.rs b/tests/corpus/scenarios/comment-edit-conflict/O.rs
new file mode 100644
index 0000000..76e5560
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-conflict/O.rs
@@ -0,0 +1,2 @@
+// v1
+fn f() {}
diff --git a/tests/corpus/scenarios/comment-edit-conflict/expected.CONFLICT b/tests/corpus/scenarios/comment-edit-conflict/expected.CONFLICT
new file mode 100644
index 0000000..24a6d10
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-conflict/expected.CONFLICT
@@ -0,0 +1 @@
+relabel-relabel
diff --git a/tests/corpus/scenarios/comment-edit-java/A.java b/tests/corpus/scenarios/comment-edit-java/A.java
new file mode 100644
index 0000000..ca9a532
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-java/A.java
@@ -0,0 +1,4 @@
+class C {
+    /** Runs it carefully. */
+    void run() { }
+}
diff --git a/tests/corpus/scenarios/comment-edit-java/B.java b/tests/corpus/scenarios/comment-edit-java/B.java
new file mode 100644
index 0000000..d0880f7
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-java/B.java
@@ -0,0 +1,6 @@
+class C {
+    /** Runs it. */
+    void run() { }
+
+    void stop() { }
+}
diff --git a/tests/corpus/scenarios/comment-edit-java/O.java b/tests/corpus/scenarios/comment-edit-java/O.java
new file mode 100644
index 0000000..a283750
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-java/O.java
@@ -0,0 +1,4 @@
+class C {
+    /** Runs it. */
+    void run() { }
+}
diff --git a/tests/corpus/scenarios/comment-edit-java/expected.java b/tests/corpus/scenarios/comment-edit-java/expected.java
new file mode 100644
index 0000000..87188fc
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit-java/expected.java
@@ -0,0 +1,6 @@
+class C {
+    /** Runs it carefully. */
+    void run() { }
+
+    void stop() { }
+}
diff --git a/tests/corpus/scenarios/comment-edit/A.rs b/tests/corpus/scenarios/comment-edit/A.rs
new file mode 100644
index 0000000..8ae9316
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit/A.rs
@@ -0,0 +1,4 @@
+// call the improved thing
+fn f() {
+    x();
+}
diff --git a/tests/corpus/scenarios/comment-edit/B.rs b/tests/corpus/scenarios/comment-edit/B.rs
new file mode 100644
index 0000000..ff42fba
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit/B.rs
@@ -0,0 +1,4 @@
+// call the thing
+fn f() {
+    y();
+}
diff --git a/tests/corpus/scenarios/comment-edit/O.rs b/tests/corpus/scenarios/comment-edit/O.rs
new file mode 100644
index 0000000..4f1e89f
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit/O.rs
@@ -0,0 +1,4 @@
+// call the thing
+fn f() {
+    x();
+}
diff --git a/tests/corpus/scenarios/comment-edit/expected.rs b/tests/corpus/scenarios/comment-edit/expected.rs
new file mode 100644
index 0000000..06ea220
--- /dev/null
+++ b/tests/corpus/scenarios/comment-edit/expected.rs
@@ -0,0 +1,4 @@
+// call the improved thing
+fn f() {
+    y();
+}
diff --git a/tests/corpus/scenarios/comment-insert-conflict/A.rs b/tests/corpus/scenarios/comment-insert-conflict/A.rs
new file mode 100644
index 0000000..9a5a1bf
--- /dev/null
+++ b/tests/corpus/scenarios/comment-insert-conflict/A.rs
@@ -0,0 +1 @@
+use crate::{foo, /* bar */};
diff --git a/tests/corpus/scenarios/comment-insert-conflict/B.rs b/tests/corpus/scenarios/comment-insert-conflict/B.rs
new file mode 100644
index 0000000..b39db7b
--- /dev/null
+++ b/tests/corpus/scenarios/comment-insert-conflict/B.rs
@@ -0,0 +1 @@
+use crate::{foo, /* baz */};
diff --git a/tests/corpus/scenarios/comment-insert-conflict/O.rs b/tests/corpus/scenarios/comment-insert-conflict/O.rs
new file mode 100644
index 0000000..68bf28b
--- /dev/null
+++ b/tests/corpus/scenarios/comment-insert-conflict/O.rs
@@ -0,0 +1 @@
+use crate::{foo};
diff --git a/tests/corpus/scenarios/comment-insert-conflict/expected.CONFLICT b/tests/corpus/scenarios/comment-insert-conflict/expected.CONFLICT
new file mode 100644
index 0000000..8ea65cd
--- /dev/null
+++ b/tests/corpus/scenarios/comment-insert-conflict/expected.CONFLICT
@@ -0,0 +1 @@
+insert-insert