(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestBytesToStringGC(t *testing.T) { |
| 74 | var ( |
| 75 | expect = t.Name() |
| 76 | x string |
| 77 | wg sync.WaitGroup |
| 78 | ) |
| 79 | |
| 80 | wg.Add(1) |
| 81 | go func() { |
| 82 | defer wg.Done() |
| 83 | tmp := append([]byte(nil), t.Name()...) |
| 84 | x = BytesToString(tmp) |
| 85 | }() |
| 86 | wg.Wait() |
| 87 | |
| 88 | for i := 0; i < 100; i++ { |
| 89 | runtime.GC() |
| 90 | } |
| 91 | |
| 92 | if !reflect.DeepEqual(expect, x) { |
| 93 | t.Errorf("Expected = %v, Got = %v", expect, x) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | func TestStringToBytesGC(t *testing.T) { |
| 98 | var ( |
nothing calls this directly
no test coverage detected