MCPcopy
hub / github.com/perkeep/perkeep / GetWorld

Function GetWorld

pkg/test/world.go:330–345  ·  view source on GitHub ↗

GetWorld returns (creating if necessary) a test singleton world. It calls Fatal on the provided test if there are problems.

(t *testing.T)

Source from the content-addressed store, hash-verified

328// GetWorld returns (creating if necessary) a test singleton world.
329// It calls Fatal on the provided test if there are problems.
330func GetWorld(t *testing.T) *World {
331 w := theWorld
332 if w == nil {
333 var err error
334 w, err = NewWorld()
335 if err != nil {
336 t.Fatalf("Error finding test world: %v", err)
337 }
338 err = w.Start()
339 if err != nil {
340 t.Fatalf("Error starting test world: %v", err)
341 }
342 theWorld = w
343 }
344 return w
345}
346
347// GetWorldMaybe returns the current World. It might be nil.
348func GetWorldMaybe(t *testing.T) *World {

Callers 15

ImporterTestFunction · 0.92
TestCamputFIFOFunction · 0.92
TestCamputSocketFunction · 0.92
TestCamputUploadOnceFunction · 0.92
TestSetNamedFunction · 0.92
TestGetNamedFunction · 0.92
TestNamedSearchFunction · 0.92
TestNestedNamedSearchFunction · 0.92
TestNonUTF8FileNameFunction · 0.92
TestNonUTF8SymlinkTargetFunction · 0.92
TestCamputPermanodeFunction · 0.92
TestWebsocketQueryFunction · 0.92

Calls 3

NewWorldFunction · 0.85
FatalfMethod · 0.65
StartMethod · 0.65

Tested by 15

TestCamputFIFOFunction · 0.74
TestCamputSocketFunction · 0.74
TestCamputUploadOnceFunction · 0.74
TestSetNamedFunction · 0.74
TestGetNamedFunction · 0.74
TestNamedSearchFunction · 0.74
TestNestedNamedSearchFunction · 0.74
TestNonUTF8FileNameFunction · 0.74
TestNonUTF8SymlinkTargetFunction · 0.74
TestCamputPermanodeFunction · 0.74
TestWebsocketQueryFunction · 0.74
TestInternalHandlerFunction · 0.74