MCPcopy Create free account
hub / github.com/pace/bricks / ExampleTest

Function ExampleTest

test/livetest/livetest_example_test.go:13–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func ExampleTest() {
14 ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100)
15 defer cancel()
16
17 err := livetest.Test(ctx, []livetest.TestFunc{
18 func(t *livetest.T) {
19 t.Logf("Executed test no %d", 1)
20 },
21 func(t *livetest.T) {
22 t.Log("Executed test no 2")
23 },
24 func(t *livetest.T) {
25 t.Fatal("Fail test no 3")
26 },
27 func(t *livetest.T) {
28 t.Fatalf("Fail test no %d", 4)
29 },
30 func(t *livetest.T) {
31 t.Skip("Skipping test no 5")
32 },
33 func(t *livetest.T) {
34 t.Skipf("Skipping test no %d", 5)
35 },
36 func(t *livetest.T) {
37 t.SkipNow()
38 },
39 func(t *livetest.T) {
40 t.Fail()
41 },
42 func(t *livetest.T) {
43 t.FailNow()
44 },
45 func(t *livetest.T) {
46 t.Error("Some")
47 },
48 func(t *livetest.T) {
49 t.Errorf("formatted")
50 },
51 })
52 if err != context.DeadlineExceeded {
53 log.Fatal(err)
54 }
55 // Output:
56}

Callers

nothing calls this directly

Calls 12

TestFunction · 0.92
LogfMethod · 0.80
LogMethod · 0.80
FatalMethod · 0.80
FatalfMethod · 0.80
SkipMethod · 0.80
SkipfMethod · 0.80
SkipNowMethod · 0.80
FailMethod · 0.80
FailNowMethod · 0.80
ErrorfMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…