nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: infinitered/solidarity
Pull request #191 (2018-03-15 21:10:01)

fix: retain semver symbols on snapshot update
Previously, this rule would update semver to "8.10.0" on `solidarity snapshot`, rather than the expected "~8.10.0". 

```
"Node": [
      {
        "rule": "cli",
        "binary": "node",
        "semver": "~8.9.4",
     }
]
```

GantMan: Windows tests seem unrelated.

Patch:
diff --git a/src/extensions/functions/checkCLIForUpdates.ts b/src/extensions/functions/checkCLIForUpdates.ts
index c1c4599..7c48652 100644
--- a/src/extensions/functions/checkCLIForUpdates.ts
+++ b/src/extensions/functions/checkCLIForUpdates.ts
@@ -20,10 +20,10 @@ module.exports = async (rule: CLIRule, context: SolidarityRunContext): Promise<s
     binarySemantic += '.0'
   }
 
-  // if it doesn't satisfy, upgrade
+  // if it doesn't satisfy, upgrade, and retain semver symbol
   if (rule.semver && !semver.satisfies(binarySemantic, rule.semver)) {
-    rule.semver = binaryVersion
+    rule.semver = `${/\^|\~/.test(rule.semver) ? rule.semver.charAt(0) : ''}${binaryVersion}`
     const lineMessage = rule.line ? ` line ${rule.line}` : ''
-    return print.colors.green(`Setting ${rule.binary}${lineMessage} to '${binaryVersion}'`)
+    return print.colors.green(`Setting ${rule.binary}${lineMessage} to '${rule.semver}'`)
   }
 }


Test patch:
diff --git a/__tests__/command_helpers/checkCLIForUpdates.ts b/__tests__/command_helpers/checkCLIForUpdates.ts
index fded26a..9cc4f60 100644
--- a/__tests__/command_helpers/checkCLIForUpdates.ts
+++ b/__tests__/command_helpers/checkCLIForUpdates.ts
@@ -8,6 +8,13 @@ const rule = {
   version: '--version',
 }
 
+const ruleTildeSemver = {
+  rule: 'cli',
+  binary: 'npm',
+  semver: '~5.6.0',
+  version: '--version',
+}
+
 const ruleNoSemver = {
   rule: 'cli',
   binary: 'yarn',
@@ -50,5 +57,14 @@ describe('checkCLIForUpdates', () => {
       expect(result).toEqual(undefined)
       expect(ruleNoSemver.semver).toBe(undefined)
     })
+
+    it('copies semver ~ symbol if present', async () => {
+      context.solidarity = {
+        getVersion: jest.fn(() => '5.8'),
+      }
+
+      const result = await checkCLIForUpdates(ruleTildeSemver, context)
+      expect(result).toEqual("Setting npm to '~5.8'")
+    })
   })
 })
Repository: cheeriojs/cheerio
Pull request #796 (2016-01-02 12:00:37)

Fix unexpected behavior while querying child
I followed [the solution of fb55](https://github.com/cheeriojs/cheerio/issues/780#issuecomment-166870067) and I added a unit test to ensure that #742 and #780 was correctly fixed.


Patch:
diff --git a/lib/api/traversing.js b/lib/api/traversing.js
index 8e184229..bda433ea 100644
--- a/lib/api/traversing.js
+++ b/lib/api/traversing.js
@@ -29,7 +29,9 @@ exports.find = function(selectorOrHaystack) {
     }, this));
   }
 
-  return this._make(select(selectorOrHaystack, elems, this.options));
+  var options = {__proto__: this.options, context: this.toArray()};
+
+  return this._make(select(selectorOrHaystack, elems, options));
 };
 
 // Get the parent of each element in the current set of matched elements,


Test patch:
diff --git a/test/api/traversing.js b/test/api/traversing.js
index 7ed5786a..7ace2443 100644
--- a/test/api/traversing.js
+++ b/test/api/traversing.js
@@ -47,6 +47,11 @@ describe('$(...)', function() {
       expect($('#fruits').find('LI')).to.have.length(3);
     });
 
+    it('should query immediate descendant only', function() {
+      var $ = cheerio.load('<foo><bar><bar></bar><bar></bar></bar></foo>');
+      expect($('foo').find('> bar')).to.have.length(1);
+    });
+
     it('should query case-sensitively when in xmlMode', function() {
       var q = cheerio.load('<caseSenSitive allTheWay>', {xmlMode: true});
       expect(q('caseSenSitive')).to.have.length(1);
Repository: kyeotic/raviger
Pull request #7 (2019-08-29 22:22:01)

add type check to navigate


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 751237d..0ad834e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [0.3.9] - 2019-08-29
+### Added
+- `navigate` checks `url` param
+
+## [0.3.8] - 2019-08-27
+### Fixed
+- `useRedirect` adding null query
+
+## [0.3.6] - 2019-08-27
+### Fixed
+- Rollup dist output
+
 ## [0.3.4] - 2019-08-21
 ### Added
 - `useRedirect` hook
diff --git a/src/router.js b/src/router.js
index d830181..d276fc2 100644
--- a/src/router.js
+++ b/src/router.js
@@ -30,6 +30,9 @@ export function useRoutes(routes, basePath = '') {
 }
 
 export function navigate(url, replaceOrQuery = false, replace = false) {
+  if (typeof url === 'object') {
+    throw new Error('"url" must be a string, was provided an object.')
+  }
   if (replaceOrQuery && typeof replaceOrQuery === 'object') {
     url += '?' + new URLSearchParams(replaceOrQuery).toString()
   } else {


Test patch:
diff --git a/test/router.spec.js b/test/router.spec.js
index 7353ef0..4b8f0a5 100644
--- a/test/router.spec.js
+++ b/test/router.spec.js
@@ -188,4 +188,7 @@ describe('navigate', () => {
     expect(window.location.search).toContain('q=name')
     expect(window.location.search).toContain('env=test')
   })
+  test('throws when url is an object', async () => {
+    expect(() => navigate({})).toThrow(/must be a string/)
+  })
 })