aboutsummaryrefslogtreecommitdiffstats
path: root/bug/bug.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/bug.go')
-rw-r--r--bug/bug.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/bug/bug.go b/bug/bug.go
index 2ee89031..3a770881 100644
--- a/bug/bug.go
+++ b/bug/bug.go
@@ -749,3 +749,22 @@ func (bug *Bug) Compile() Snapshot {
return snap
}
+
+// EquivalentBug returns true if two bugs are equal
+func EquivalentBug(expected, actual *Bug) bool {
+ if len(expected.packs) != len(actual.packs) {
+ return false
+ }
+
+ for i := range expected.packs {
+ for j := range expected.packs[i].Operations {
+ actual.packs[i].Operations[j].base().id = expected.packs[i].Operations[j].base().id
+ }
+ }
+
+ if expected != actual {
+ return false
+ }
+
+ return true
+}