PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: tomekpiotrowski/lets_expect (rust)

Issue:
Handle `Expr::Index` in `expr_to_ident`

Pull request:
Handle `Expr::Index` in `expr_to_ident`
Fixes #81

Patch:
diff --git a/lets_expect_core/src/utils/to_ident.rs b/lets_expect_core/src/utils/to_ident.rs
index 70ee614..255f995 100644
--- a/lets_expect_core/src/utils/to_ident.rs
+++ b/lets_expect_core/src/utils/to_ident.rs
@@ -83,7 +83,11 @@ pub fn expr_to_ident(expr: &syn::Expr) -> String {
         Expr::ForLoop(_) => unimplemented!("ForLoop not supported"),
         Expr::Group(_) => unimplemented!("Group not supported"),
         Expr::If(if_expr) => "if_".to_string() + &expr_to_ident(&if_expr.cond),
-        Expr::Index(_) => unimplemented!("Index not supported"),
+        Expr::Index(index) => format!(
+            "{}_at_{}",
+            expr_to_ident(&index.expr),
+            expr_to_ident(&index.index)
+        ),
         Expr::Let(_) => unimplemented!("Let not supported"),
         Expr::Lit(lit) => expr_lit_to_ident(lit),
         Expr::Loop(_) => unimplemented!("Loop not supported"),


Test patch:
diff --git a/tests/array.rs b/tests/array.rs
index 72a435e..be6f955 100644
--- a/tests/array.rs
+++ b/tests/array.rs
@@ -2,6 +2,10 @@
 mod tests {
     use lets_expect::lets_expect;
 
+    struct Array<T> {
+        data: [T; 3],
+    }
+
     lets_expect! {
         expect([] as [u8; 0]) {
             to have(len()) equal(0)
@@ -15,5 +19,9 @@ mod tests {
             to have(mut iter()) all(be_greater_than(0))
             to have(mut iter()) any(be_less_or_equal_to(1))
         }
+
+        expect(Array { data: [1, 2, 3] }) {
+            to have(data[0]) equal(1)
+        }
     }
 }
Repository: skovhus/jest-codemods (ts)

Issue:
jasmine *.calls.reset() should be replaced by *.mockReset()
jasmine has a namespace `calls` on spies with a method called `reset()` , [see their docs](https://jasmine.github.io/api/5.2/Spy_calls.html).

## Desired behaviour
Input:
```ts
mySpy.calls.reset();
```

should be transformed to:
```ts
mySpy.mockReset();
```

Pull request:
feat(jasmine): add support for *.calls.reset()
fixes #602 

Patch:
diff --git a/src/transformers/jasmine-globals.ts b/src/transformers/jasmine-globals.ts
index 8a35add..1c48066 100644
--- a/src/transformers/jasmine-globals.ts
+++ b/src/transformers/jasmine-globals.ts
@@ -271,6 +271,27 @@ export default function jasmineGlobals(fileInfo, api, options) {
       j(path).replaceWith(path.node.callee)
     })
 
+  root
+    .find(j.CallExpression, {
+      // find all `*.calls.reset()`
+      callee: {
+        type: 'MemberExpression',
+        property: { type: 'Identifier', name: 'reset' },
+        object: {
+          type: 'MemberExpression',
+          property: { type: 'Identifier', name: 'calls' },
+        },
+      },
+    })
+    .forEach((path) => {
+      j(path).replaceWith(
+        j.callExpression(
+          j.memberExpression(path.node.callee.object.object, j.identifier('mockReset')),
+          []
+        )
+      )
+    })
+
   root
     .find(j.MemberExpression, {
       // find all `stuff.callCount`


Test patch:
diff --git a/src/transformers/jasmine-globals.test.ts b/src/transformers/jasmine-globals.test.ts
index 2a37635..37fc2ba 100644
--- a/src/transformers/jasmine-globals.test.ts
+++ b/src/transformers/jasmine-globals.test.ts
@@ -135,6 +135,21 @@ test('*.calls.count()', () => {
   )
 })
 
+test('*.calls.reset()', () => {
+  expectTransformation(
+    `
+    someMock.calls.reset();
+    stuff.someMock.calls.reset();
+    getMock(stuff).calls.reset();
+    `,
+    `
+    someMock.mockReset();
+    stuff.someMock.mockReset();
+    getMock(stuff).mockReset();
+    `
+  )
+})
+
 test('*.mostRecentCall', () => {
   expectTransformation(
     `
Repository: stretchr/testify (go)

Issue:
Using error in Contains fails with confusing message
https://play.golang.org/p/u7Dfo4UnxZ0
```go
assert.Contains(t, "error string", errors.New("error"))
```
```
Error Trace:	prog.go:25
Error:      	"error string" does not contain "error"
Test:       	TestCaseA
```

Whereas this is what's needed to pass:
```diff
-assert.Contains(t, "error string", errors.New("error"))
+assert.Contains(t, "error string", errors.New("error").Error())
```

I would prefer if the failure message explained that it was an error type, otherwise it looks like a string does not contain another string: I've fallen foul to this in the past, and just spent 5-10mins again not realising that I needed to pass a `string` type as the 3rd argument.

It would be really nice to have the type printed here when the value isn't a `Stringer` =)

Pull request:
Test for #913
Fixes #828

Patch:
diff --git a/assert/assertions.go b/assert/assertions.go
index 00ff8d2..7bedb20 100644
--- a/assert/assertions.go
+++ b/assert/assertions.go
@@ -760,10 +760,10 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo
 
 	ok, found := includeElement(s, contains)
 	if !ok {
-		return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...)
+		return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...)
 	}
 	if !found {
-		return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...)
+		return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...)
 	}
 
 	return true


Test patch:
diff --git a/assert/assertions_test.go b/assert/assertions_test.go
index ef22bd2..b5e73ea 100644
--- a/assert/assertions_test.go
+++ b/assert/assertions_test.go
@@ -592,6 +592,18 @@ func TestContains(t *testing.T) {
 	}
 }
 
+func TestContainsFailMessage(t *testing.T) {
+
+	mockT := new(mockTestingT)
+
+	Contains(mockT, "Hello World", errors.New("Hello"))
+	expectedFail := "\"Hello World\" does not contain &errors.errorString{s:\"Hello\"}"
+	actualFail := mockT.errorString()
+	if !strings.Contains(actualFail, expectedFail) {
+		t.Errorf("Contains failure should include %q but was %q", expectedFail, actualFail)
+	}
+}
+
 func TestNotContains(t *testing.T) {
 
 	mockT := new(testing.T)
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 191
Good morning! Here's your coding interview problem for today.

This problem was asked by Stripe.

Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.

Intervals can "touch", such as `[0, 1]` and `[1, 2]`, but they won't be considered overlapping.

For example, given the intervals `(7, 9), (2, 4), (5, 8)`, return `1` as the last interval can be removed and the first two won't overlap.

The intervals are not necessarily sorted in any order.

Pull request:
Day191
Resolves #395.

Patch:
diff --git a/README.md b/README.md
index 6ce3b31..c3633e6 100644
--- a/README.md
+++ b/README.md
@@ -201,3 +201,4 @@ problems from
 * [Day 188](https://github.com/vaskoz/dailycodingproblem-go/issues/388)
 * [Day 189](https://github.com/vaskoz/dailycodingproblem-go/issues/391)
 * [Day 190](https://github.com/vaskoz/dailycodingproblem-go/issues/393)
+* [Day 191](https://github.com/vaskoz/dailycodingproblem-go/issues/395)
diff --git a/day191/problem.go b/day191/problem.go
new file mode 100644
index 0000000..2c86b08
--- /dev/null
+++ b/day191/problem.go
@@ -0,0 +1,26 @@
+package day191
+
+import "sort"
+
+// Interval has a start and end.
+type Interval struct {
+	Start, End int
+}
+
+// MinRemoveNoOverlap returns the minimum number of intervals
+// to remove to remove all overlaps.
+// Runs in O(N log N) time.
+func MinRemoveNoOverlap(intervals []Interval) int {
+	sort.Slice(intervals, func(i, j int) bool {
+		return intervals[i].End < intervals[j].End
+	})
+	count := 0
+	current := -int(^uint(0)>>1) - 1
+	for _, interval := range intervals {
+		if interval.Start >= current {
+			count++
+			current = interval.End
+		}
+	}
+	return len(intervals) - count
+}


Test patch:
diff --git a/day191/problem_test.go b/day191/problem_test.go
new file mode 100644
index 0000000..cd0f77a
--- /dev/null
+++ b/day191/problem_test.go
@@ -0,0 +1,27 @@
+package day191
+
+import "testing"
+
+var testcases = []struct {
+	intervals []Interval
+	removes   int
+}{
+	{[]Interval{{7, 9}, {2, 4}, {5, 8}}, 1},
+}
+
+func TestMinRemoveNoOverlap(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MinRemoveNoOverlap(tc.intervals); result != tc.removes {
+			t.Errorf("Expected %v, got %v", tc.removes, result)
+		}
+	}
+}
+
+func BenchmarkMinRemoveNoOverlap(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MinRemoveNoOverlap(tc.intervals)
+		}
+	}
+}