(t *testing.T)
| 60 | } |
| 61 | |
| 62 | func TestStat(t *testing.T) { |
| 63 | mock, err := newMock(t) |
| 64 | if err != nil { |
| 65 | t.Fatal(err) |
| 66 | } |
| 67 | defer func() { |
| 68 | if err := mock.delete(); err != nil { |
| 69 | t.Errorf("failed delete: %v", err) |
| 70 | } |
| 71 | }() |
| 72 | control, err := New(StaticPath("test"), &specs.LinuxResources{}, WithHierarchy(mock.hierarchy)) |
| 73 | if err != nil { |
| 74 | t.Error(err) |
| 75 | return |
| 76 | } |
| 77 | s, err := control.Stat(IgnoreNotExist) |
| 78 | if err != nil { |
| 79 | t.Error(err) |
| 80 | return |
| 81 | } |
| 82 | if s == nil { |
| 83 | t.Error("stat result is nil") |
| 84 | return |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestAdd(t *testing.T) { |
| 89 | mock, err := newMock(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…