mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-06 07:36:37 +08:00
feat(core): implement plugin fiber state machine and reactive dependency reconciler
This commit is contained in:
@@ -238,14 +238,14 @@ func TestContextHierarchyAndFork(t *testing.T) {
|
||||
|
||||
// Child provides LogService
|
||||
childLog := &logServiceImpl{}
|
||||
core.Provide[LogService](child, childLog)
|
||||
core.ProvideScoped[LogService](child, childLog)
|
||||
|
||||
// Child has LogService, parent does not
|
||||
assert.True(t, core.Has[LogService](child))
|
||||
assert.False(t, core.Has[LogService](parent))
|
||||
|
||||
// Child overrides SampleService
|
||||
core.Provide[SampleService](child, &sampleServiceImpl{prefix: "Child:"})
|
||||
// Child overrides SampleService locally
|
||||
core.ProvideScoped[SampleService](child, &sampleServiceImpl{prefix: "Child:"})
|
||||
childSvc, err := core.Inject[SampleService](child)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "Child: Ryan", childSvc.Greet("Ryan"))
|
||||
|
||||
Reference in New Issue
Block a user