MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / TestRegistry_ReadFile_FirstPluginWins

Function TestRegistry_ReadFile_FirstPluginWins

internal/plugins/plugins_test.go:279–293  ·  view source on GitHub ↗

--------------------------------------------------------------------------- pluginRegistry first-wins semantics --------------------------------------------------------------------------- When two plugins both expose the same short path, the first registry entry wins (ReadFile returns the first matc

(t *testing.T)

Source from the content-addressed store, hash-verified

277// When two plugins both expose the same short path, the first registry entry
278// wins (ReadFile returns the first match and does not error).
279func TestRegistry_ReadFile_FirstPluginWins(t *testing.T) {
280 origRegistry := registry
281 origOpen := registrationOpen
282 t.Cleanup(func() {
283 registry = origRegistry
284 registrationOpen = origOpen
285 })
286 p1 := newTestPlugin(t)
287 p2 := newTestPlugin(t)
288 registry = pluginRegistry{p1, p2}
289
290 b, err := registry.ReadFile("html/public/index.html")
291 require.NoError(t, err)
292 assert.NotEmpty(t, b)
293}
294
295// ---------------------------------------------------------------------------
296// WriteBytes / ReadBytes round-trip

Callers

nothing calls this directly

Calls 2

newTestPluginFunction · 0.85
ReadFileMethod · 0.45

Tested by

no test coverage detected