PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: yargs/yargs (js)

Issue:
recommended commands takes precedence over help message
```
slackboard org
```

```
slackboard org <subcommand|help>

Commands:
  add-user      add a user to an org.

Options:
  --help  Show help                                                                        [boolean]

Did you mean get?
```

Pull request:
fix: help now takes precedence over command recommendation
fixes #854 

Patch:
diff --git a/yargs.js b/yargs.js
index a3eb0c2..078bf8f 100644
--- a/yargs.js
+++ b/yargs.js
@@ -1002,7 +1002,7 @@ function Yargs (processArgs, cwd, parentRequire) {
 
           // recommend a command if recommendCommands() has
           // been enabled, and no commands were found to execute
-          if (recommendCommands && firstUnknownCommand) {
+          if (recommendCommands && firstUnknownCommand && !argv[helpOpt]) {
             validation.recommendCommands(firstUnknownCommand, handlerKeys)
           }
         }


Test patch:
diff --git a/test/yargs.js b/test/yargs.js
index 20a9f26..e831c99 100644
--- a/test/yargs.js
+++ b/test/yargs.js
@@ -338,15 +338,14 @@ describe('yargs dsl tests', function () {
     })
 
     // see: https://github.com/yargs/yargs/issues/822
-    it('does not print help message if recommendation has been made', function (done) {
+    it('does not print command recommendation if help message will be shown', function (done) {
       const parser = yargs()
         .command('goat')
         .help()
         .recommendCommands()
 
       parser.parse('boat help', {}, function (err, _argv, output) {
-        // it should not have printed the help text twice!
-        err.message.should.equal('Did you mean goat?')
+        if (err) return done(err)
         output.split('Commands:').length.should.equal(2)
         return done()
       })
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 199
Good morning! Here's your coding interview problem for today.

This problem was asked by Facebook.

Given a string of parentheses, find the balanced string that can be produced from it using the minimum number of insertions and deletions. If there are multiple solutions, return any of them.

For example, given `"(()"`, you could return `"(())"`. Given `"))()("`, you could return `"()()()()"`.

Pull request:
Day199
Resolves #409.

Patch:
diff --git a/README.md b/README.md
index 5ceabd7..ff4f882 100644
--- a/README.md
+++ b/README.md
@@ -207,3 +207,4 @@ problems from
 * [Day 195](https://github.com/vaskoz/dailycodingproblem-go/issues/401)
 * [Day 196](https://github.com/vaskoz/dailycodingproblem-go/issues/404)
 * [Day 197](https://github.com/vaskoz/dailycodingproblem-go/issues/405)
+* [Day 199](https://github.com/vaskoz/dailycodingproblem-go/issues/409)
diff --git a/day199/problem.go b/day199/problem.go
new file mode 100644
index 0000000..d63a869
--- /dev/null
+++ b/day199/problem.go
@@ -0,0 +1,25 @@
+package day199
+
+import "strings"
+
+// BalanceParens balances unbalanced parens.
+// Runs in O(N) time and O(N) extra space.
+// Only accepts a string composed of '(' and ')'.
+func BalanceParens(parens string) string {
+	var sb strings.Builder
+	opens := 0
+	for _, r := range parens {
+		if r == '(' {
+			opens++
+		} else if r == ')' && opens == 0 {
+			sb.WriteRune('(')
+		} else {
+			opens--
+		}
+		sb.WriteRune(r)
+	}
+	for i := 0; i < opens; i++ {
+		sb.WriteRune(')')
+	}
+	return sb.String()
+}


Test patch:
diff --git a/day199/problem_test.go b/day199/problem_test.go
new file mode 100644
index 0000000..b78a3f1
--- /dev/null
+++ b/day199/problem_test.go
@@ -0,0 +1,29 @@
+package day199
+
+import "testing"
+
+var testcases = []struct {
+	parens   string
+	expected string
+}{
+	{"(()", "(())"},
+	{"))()(", "()()()()"},
+	{"))(", "()()()"},
+}
+
+func TestBalanceParens(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := BalanceParens(tc.parens); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkBalanceParens(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			BalanceParens(tc.parens)
+		}
+	}
+}
Repository: JsonMapper/JsonMapper (php)

Issue:
PHP 8.0 is allowed to fail
**Describe the bug**
In the build chain PHP 8.0 (Nightly) is still allowed to fail.

**To Reproduce**
Steps to reproduce the behavior:
See the build report where Nightly is allowed to fail.

**Expected behavior**
A breaking test in PHP 8.0 should fail the build. The Nightly (target PHP 8.1) is still allowed to fail.

**Stacktrace**
N/A

**Environment (please complete the following information):**
 - PHP: 8.0
 
**Additional context**
N/A


Pull request:
Update build chain
This PR would fix #69 

Patch:
diff --git a/.travis.yml b/.travis.yml
index 6064111..c2c5b0c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,9 @@ matrix:
     - php: 7.4
     - php: 7.4
       env: COMPOSER_UPDATE_FLAGS='--prefer-lowest --prefer-stable'
+    - php: 8.0
+    - php: 8.0
+      env: COMPOSER_UPDATE_FLAGS='--prefer-lowest --prefer-stable'
 
       # Ignore the platform requirements for the upcoming PHP version
     - php: nightly
@@ -33,7 +36,6 @@ branches:
   only:
     - master
     - develop
-    - 2.x
 
 install:
   - curl -s http://getcomposer.org/installer | php
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b1d68f9..18f71e5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [Unreleased]
 ### Added
 - Support variadic setter function. [PR#68](https://github.com/JsonMapper/JsonMapper/pull/68)
+### Fixed
+- Include PHP 8.0 in the build matrix. [PR#70](https://github.com/JsonMapper/JsonMapper/pull/70)
 
 ## [2.0.0] - 2021-01-07
 ### Changed


Test patch:
diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml
index 517d773..8b2d31b 100644
--- a/.github/workflows/run-tests.yaml
+++ b/.github/workflows/run-tests.yaml
@@ -2,9 +2,9 @@ name: Run tests
 
 on:
   push:
-    branches: [ develop, master, 2.0.0-dev ]
+    branches: [ develop, master ]
   pull_request:
-    branches: [ develop, master, 2.x ]
+    branches: [ develop, master ]
 
 jobs:
   build:
@@ -34,14 +34,23 @@ jobs:
             composer_update_flags: '--prefer-lowest --prefer-stable'
             name: 'PHP 7.4 with lowest stable deps'
           - php: 8.0
-            allow_fail: true
+            allow_fail: false
             php_ini: 'xdebug.coverage_enable=On'
             name: 'PHP 8.0 with latest deps'
           - php: 8.0
-            allow_fail: true
+            allow_fail: false
             composer_update_flags: '--prefer-lowest --prefer-stable'
             php_ini: 'xdebug.coverage_enable=On'
             name: 'PHP 8.0 with lowest stable deps'
+          - php: 8.1
+            allow_fail: true
+            php_ini: 'xdebug.coverage_enable=On'
+            name: 'PHP 8.1 with latest deps'
+          - php: 8.1
+            allow_fail: true
+            composer_update_flags: '--prefer-lowest --prefer-stable'
+            php_ini: 'xdebug.coverage_enable=On'
+            name: 'PHP 8.1 with lowest stable deps'
 
     runs-on: ubuntu-latest
Repository: stretchr/testify (go)

Issue:
Integer overflow in time.Time comparison
## Description
time.Time comparison rely on https://pkg.go.dev/time#Time.UnixNano, but documentation explicitly said, that it has undefined behavior is data is bigger than year 2262 (since it not fit in int64)

## Step To Reproduce
```go
func TestTime(t *testing.T) {
	require.Less(t, time.Now(), time.Date(2263, 0, 0, 0, 0, 0, 0, time.Local))
}
```
Error:      	"2024-03-29 08:20:14.8719425 +0300 MSK m=+0.001135586" is not less than "2262-11-30 00:00:00 +0300 MSK"



Pull request:
Fix time.Time compare
fix #1581

I was eager to use [Time.Compare](https://pkg.go.dev/time#Time.Compare), but it was added only in go 1.20

Patch:
diff --git a/assert/assertion_compare.go b/assert/assertion_compare.go
index 0504ddb..c60e4e8 100644
--- a/assert/assertion_compare.go
+++ b/assert/assertion_compare.go
@@ -328,7 +328,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (compareResult, bool) {
 				timeObj2 = obj2Value.Convert(timeType).Interface().(time.Time)
 			}
 
-			return compare(timeObj1.UnixNano(), timeObj2.UnixNano(), reflect.Int64)
+			if timeObj1.Before(timeObj2) {
+				return compareLess, true
+			}
+			if timeObj1.Equal(timeObj2) {
+				return compareEqual, true
+			}
+			return compareGreater, true
 		}
 	case reflect.Slice:
 		{


Test patch:
diff --git a/assert/assertion_compare_test.go b/assert/assertion_compare_test.go
index b47a76d..bf6b816 100644
--- a/assert/assertion_compare_test.go
+++ b/assert/assertion_compare_test.go
@@ -59,6 +59,7 @@ func TestCompare(t *testing.T) {
 		{less: uintptr(1), greater: uintptr(2), cType: "uintptr"},
 		{less: customUintptr(1), greater: customUintptr(2), cType: "uint64"},
 		{less: time.Now(), greater: time.Now().Add(time.Hour), cType: "time.Time"},
+		{less: time.Date(2024, 0, 0, 0, 0, 0, 0, time.Local), greater: time.Date(2263, 0, 0, 0, 0, 0, 0, time.Local), cType: "time.Time"},
 		{less: customTime(time.Now()), greater: customTime(time.Now().Add(time.Hour)), cType: "time.Time"},
 		{less: []byte{1, 1}, greater: []byte{1, 2}, cType: "[]byte"},
 		{less: customBytes([]byte{1, 1}), greater: customBytes([]byte{1, 2}), cType: "[]byte"},
Repository: gin-gonic/gin (go)

Issue:
There is no method to get uint64 from context
Please add a method to context for getting uint64 like this.

func (c *Context) GetUInt64(key string) (ui64 uint64)

Pull request:
Add GetUint and GetUint64 method on gin.context
close #2432


Patch:
diff --git a/context.go b/context.go
index 95b1807..216ceca 100644
--- a/context.go
+++ b/context.go
@@ -295,6 +295,22 @@ func (c *Context) GetInt64(key string) (i64 int64) {
 	return
 }
 
+// GetUint returns the value associated with the key as an unsigned integer.
+func (c *Context) GetUint(key string) (ui uint) {
+	if val, ok := c.Get(key); ok && val != nil {
+		ui, _ = val.(uint)
+	}
+	return
+}
+
+// GetUint64 returns the value associated with the key as an unsigned integer.
+func (c *Context) GetUint64(key string) (ui64 uint64) {
+	if val, ok := c.Get(key); ok && val != nil {
+		ui64, _ = val.(uint64)
+	}
+	return
+}
+
 // GetFloat64 returns the value associated with the key as a float64.
 func (c *Context) GetFloat64(key string) (f64 float64) {
 	if val, ok := c.Get(key); ok && val != nil {


Test patch:
diff --git a/context_test.go b/context_test.go
index 1a5a3c5..e2f8de0 100644
--- a/context_test.go
+++ b/context_test.go
@@ -261,6 +261,18 @@ func TestContextGetInt64(t *testing.T) {
 	assert.Equal(t, int64(42424242424242), c.GetInt64("int64"))
 }
 
+func TestContextGetUint(t *testing.T) {
+	c, _ := CreateTestContext(httptest.NewRecorder())
+	c.Set("uint", uint(1))
+	assert.Equal(t, uint(1), c.GetUint("uint"))
+}
+
+func TestContextGetUint64(t *testing.T) {
+	c, _ := CreateTestContext(httptest.NewRecorder())
+	c.Set("uint64", uint64(18446744073709551615))
+	assert.Equal(t, uint64(18446744073709551615), c.GetUint64("uint64"))
+}
+
 func TestContextGetFloat64(t *testing.T) {
 	c, _ := CreateTestContext(httptest.NewRecorder())
 	c.Set("float64", 4.2)
Repository: Eyevinn/mp4ff (go)

Issue:
potential bug in stsc
I was looking at refactoring the following code:

https://github.com/Eyevinn/mp4ff/blob/36777400d47b11751c670be70d9d0c78a41115ff/mp4/stsc.go#L70-L77

and noticed that because it referenced `b.SampleDescriptionID[i]` inside the loop where it was iterating over `j`, it was assigning the same thing to the same element over and over again. I assume that isn't the correct logic, but didn't know what it should be.

Pull request:
fix: stsc correct handling of multiple sample description IDs
stsc did not write the first sample description ID value to correctly as a new value appeared.

Fixes #398.

Patch:
diff --git a/mp4/stsc.go b/mp4/stsc.go
index ffaac28..9671d9e 100644
--- a/mp4/stsc.go
+++ b/mp4/stsc.go
@@ -49,8 +49,12 @@ func DecodeStscSR(hdr BoxHeader, startPos uint64, sr bits.SliceReader) (Box, err
 	b := StscBox{
 		Version: byte(versionAndFlags >> 24),
 		Flags:   versionAndFlags & flagsMask,
-		Entries: make([]StscEntry, entryCount),
 	}
+	if hdr.Size != b.expectedSize(int(entryCount)) {
+		return nil, fmt.Errorf("invalid stsc box size")
+	}
+
+	b.Entries = make([]StscEntry, entryCount)
 
 	var accSampleNr uint32 = 1
 
@@ -70,7 +74,7 @@ func DecodeStscSR(hdr BoxHeader, startPos uint64, sr bits.SliceReader) (Box, err
 				if b.singleSampleDescriptionID != 0 {
 					b.SampleDescriptionID = make([]uint32, entryCount)
 					for j := 0; j < i; j++ {
-						b.SampleDescriptionID[i] = sdi
+						b.SampleDescriptionID[j] = b.singleSampleDescriptionID
 					}
 					b.singleSampleDescriptionID = 0
 				}
@@ -88,7 +92,11 @@ func (b *StscBox) Type() string {
 
 // Size - box-specific size
 func (b *StscBox) Size() uint64 {
-	return uint64(boxHeaderSize + 8 + len(b.Entries)*12)
+	return b.expectedSize(len(b.Entries))
+}
+
+func (b *StscBox) expectedSize(nrEntries int) uint64 {
+	return uint64(boxHeaderSize + 8 + nrEntries*12)
 }
 
 // Encode - write box to w


Test patch:
diff --git a/mp4/stsc_test.go b/mp4/stsc_test.go
index b5e34aa..e5ed5fe 100644
--- a/mp4/stsc_test.go
+++ b/mp4/stsc_test.go
@@ -1,6 +1,7 @@
 package mp4
 
 import (
+	"bytes"
 	"testing"
 
 	"github.com/go-test/deep"
@@ -171,3 +172,21 @@ func TestGetChunk(t *testing.T) {
 		}
 	}
 }
+
+func TestStscSampleDescriptionID(t *testing.T) {
+	box := StscBox{}
+	_ = box.AddEntry(1, 256, 1)
+	_ = box.AddEntry(2, 192, 1)
+	_ = box.AddEntry(3, 128, 2)
+	boxDiffAfterEncodeAndDecode(t, &box)
+}
+
+func TestBadSizeStsc(t *testing.T) {
+	// raw stsc box with size 16, but with one entry, so its size should be 28ß
+	raw := []byte{0x00, 0x00, 0x00, 0x10, 's', 't', 's', 'c', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
+	buf := bytes.NewBuffer(raw)
+	_, err := DecodeBox(0, buf)
+	if err == nil {
+		t.Error("expected invalid size error")
+	}
+}
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 323
Good morning! Here's your coding interview problem for today.

This problem was asked by Dropbox.

Create an algorithm to efficiently compute the approximate median of a list of numbers.

More precisely, given an unordered list of `N` numbers, find an element whose rank is between `N / 4` and `3 * N / 4`, with a high level of certainty, in less than `O(N)` time.

Pull request:
Day323
Resolves #656.

Patch:
diff --git a/README.md b/README.md
index b955c47..f6b7e26 100644
--- a/README.md
+++ b/README.md
@@ -326,3 +326,4 @@ problems from
 * [Day 320](https://github.com/vaskoz/dailycodingproblem-go/issues/650)
 * [Day 321](https://github.com/vaskoz/dailycodingproblem-go/issues/651)
 * [Day 322](https://github.com/vaskoz/dailycodingproblem-go/issues/654)
+* [Day 323](https://github.com/vaskoz/dailycodingproblem-go/issues/656)
diff --git a/day323/problem.go b/day323/problem.go
new file mode 100644
index 0000000..51ea354
--- /dev/null
+++ b/day323/problem.go
@@ -0,0 +1,31 @@
+package day323
+
+import (
+	"math/rand"
+	"sort"
+	"time"
+)
+
+// global but unexported for testing.
+// nolint
+var r = rand.New(rand.NewSource(time.Now().UnixNano()))
+
+// ApproximateMedian returns a value approximately close to
+// the real median.
+// Works by randomly sampling half (N/2) the input.
+// Runs in O(N/2) time and O(N/2) extra space.
+func ApproximateMedian(unordered []int) int {
+	size := len(unordered)
+	sampleSize := int(0.5 * float64(size))
+	picks := make(map[int]struct{}, sampleSize)
+	for len(picks) < sampleSize {
+		picks[r.Intn(size)] = struct{}{}
+	}
+	nums := make([]int, 0, len(picks))
+	for pick := range picks {
+		nums = append(nums, unordered[pick])
+	}
+	sort.Ints(nums)
+	mid := len(nums) / 2
+	return (nums[mid] + nums[mid+1]) / 2
+}


Test patch:
diff --git a/day323/problem_test.go b/day323/problem_test.go
new file mode 100644
index 0000000..b40fce1
--- /dev/null
+++ b/day323/problem_test.go
@@ -0,0 +1,33 @@
+package day323
+
+import (
+	"math/rand"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	unordered    []int
+	approxMedian int
+}{
+	{[]int{1, 10, 2, 9, 3, 8, 4, 7, 5, 6}, 7},
+	{[]int{10, 10, 10, 10, 10, 1, 1, 1, 1, 1}, 5},
+}
+
+func TestApproximateMedian(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		r = rand.New(rand.NewSource(42)) // fixed number for test determinism.
+		if median := ApproximateMedian(tc.unordered); median != tc.approxMedian {
+			t.Errorf("Expected %v, got %v", tc.approxMedian, median)
+		}
+	}
+}
+
+func BenchmarkApproximateMedian(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			ApproximateMedian(tc.unordered)
+		}
+	}
+}
Repository: ring-clojure/ring (clojure)

Issue:
Add support for Partitioned cookies (CHIPS)
Hey friends!

I'm looking to use [CHIPS](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies) in `:cookies`, but because the `set-cookie-attrs` is a private var, I can't add support for it myself:

https://github.com/ring-clojure/ring/blob/76e5d29128661225a08a9f8dfa7b07c83b6ed4da/ring-core/src/ring/middleware/cookies.clj#L21-L24

At the moment I'm using `alter-var-root` and `alter-meta` to gain access and insert it (see below), but that feels less good than maybe making it an atom and allowing it to be edited by users, or some other system that I trust y'all to come up with.

```clojure
(alter-meta! #'ring.middleware.cookies/set-cookie-attrs assoc :private false)
(alter-var-root #'ring.middleware.cookies/set-cookie-attrs assoc :partitioned "Partitioned")
```

Pull request:
Adds simple support for [Partitioned cookies](https://developer.mozilla.org/en-US/docs/Web/Privacy/Partitioned_cookies). Does no validation (requiring `:secure`). I briefly considered it, but that felt like a step too far.

Closes #492

Patch:
diff --git a/ring-core/src/ring/middleware/cookies.clj b/ring-core/src/ring/middleware/cookies.clj
index 860f5053..c082cb9a 100644
--- a/ring-core/src/ring/middleware/cookies.clj
+++ b/ring-core/src/ring/middleware/cookies.clj
@@ -21,7 +21,7 @@
 (def ^:private set-cookie-attrs
   {:domain "Domain", :max-age "Max-Age", :path "Path"
    :secure "Secure", :expires "Expires", :http-only "HttpOnly"
-   :same-site "SameSite"})
+   :same-site "SameSite", :partitioned "Partitioned"})
 
 (def ^:private same-site-values
   {:strict "Strict", :lax "Lax", :none "None"})


Test patch:
diff --git a/ring-core/test/ring/middleware/test/cookies.clj b/ring-core/test/ring/middleware/test/cookies.clj
index f19a3afb..4463f28e 100644
--- a/ring-core/test/ring/middleware/test/cookies.clj
+++ b/ring-core/test/ring/middleware/test/cookies.clj
@@ -103,6 +103,13 @@
     (is (= {"Set-Cookie" (list "a=b" "c=d")}
            (:headers resp)))))
 
+(deftest wrap-cookies-set-partitioned
+  (let [response {:cookies {"a" {:value "foo" :partitioned true}}}
+        handler  (constantly response)
+        resp     ((wrap-cookies handler) {})]
+    (is (= {"Set-Cookie" #{"a=foo" "Partitioned"}}
+           (split-set-cookie (:headers resp))))))
+
 (deftest wrap-cookies-invalid-attrs
   (let [response {:cookies {"a" {:value "foo" :invalid true}}}
         handler  (wrap-cookies (constantly response))]
Repository: vuejs/composition-api (ts)

Issue:
warning should be triggered when the injectionKey is undefined
Version: 1.0.0-rc.14

The reproduced demo is: https://codesandbox.io/s/angry-hodgkin-crnyd

The main code is as follows:

```vue
<script>
import { inject } from "@vue/composition-api";
export default {
  name: "HelloWorld",
  setup() {
    const emptyKey = inject();
    console.log(emptyKey); // should warn unfound
    return {
      msg,
    };
  },
};
</script>

```

Pull request:
fix(runtime-core):  trigger warning when the injectionKey is undefined
fix #761 

Patch:
diff --git a/src/apis/inject.ts b/src/apis/inject.ts
index 4418379..75b5301 100644
--- a/src/apis/inject.ts
+++ b/src/apis/inject.ts
@@ -48,10 +48,6 @@ export function inject(
   defaultValue?: unknown,
   treatDefaultAsFactory = false
 ) {
-  if (!key) {
-    return defaultValue
-  }
-
   const vm = getCurrentInstance()?.proxy
   if (!vm) {
     __DEV__ &&
@@ -59,6 +55,11 @@ export function inject(
     return
   }
 
+  if (!key) {
+    __DEV__ && warn(`injection "${String(key)}" not found.`, vm)
+    return defaultValue
+  }
+
   const val = resolveInject(key, vm)
   if (val !== NOT_FOUND) {
     return val


Test patch:
diff --git a/test/v3/runtime-core/apiInject.spec.ts b/test/v3/runtime-core/apiInject.spec.ts
index f4593ea..1ed7d5c 100644
--- a/test/v3/runtime-core/apiInject.spec.ts
+++ b/test/v3/runtime-core/apiInject.spec.ts
@@ -242,6 +242,28 @@ describe('api: provide/inject', () => {
     expect(`[Vue warn]: Injection "foo" not found`).toHaveBeenWarned()
   })
 
+  it('should warn unfound w/ injectionKey is undefined', () => {
+    const Provider = {
+      setup() {
+        return () => h(Consumer)
+      },
+    }
+
+    const Consumer = {
+      setup() {
+        // The emulation does not use TypeScript
+        const foo = inject(undefined as unknown as string)
+        expect(foo).toBeUndefined()
+        return () => h('div', foo as unknown as string)
+      },
+    }
+
+    const root = document.createElement('div')
+    const vm = createApp(Provider).mount(root)
+    expect(vm.$el.outerHTML).toBe(`<div></div>`)
+    expect(`[Vue warn]: injection "undefined" not found.`).toHaveBeenWarned()
+  })
+
   it('should not self-inject', () => {
     const Comp = {
       setup() {