diff options
Diffstat (limited to 'system/output_test.go')
| -rw-r--r-- | system/output_test.go | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/system/output_test.go b/system/output_test.go index b091f5ef..80abcf8d 100644 --- a/system/output_test.go +++ b/system/output_test.go @@ -158,70 +158,3 @@ func TestPrintJoinedError(t *testing.T) { }) } } - -type tcOp struct { - et Enablement - path string -} - -// test an instance of the Op interface -func (ptc tcOp) test(t *testing.T, gotOps []Op, wantOps []Op, fn string) { - if len(gotOps) != len(wantOps) { - t.Errorf("%s: inserted %v Ops, want %v", fn, - len(gotOps), len(wantOps)) - return - } - - t.Run("path", func(t *testing.T) { - if len(gotOps) > 0 { - if got := gotOps[0].Path(); got != ptc.path { - t.Errorf("Path() = %q, want %q", - got, ptc.path) - return - } - } - }) - - for i := range gotOps { - o := gotOps[i] - - t.Run("is", func(t *testing.T) { - if !o.Is(o) { - t.Errorf("Is returned false on self") - return - } - if !o.Is(wantOps[i]) { - t.Errorf("%s: inserted %#v, want %#v", - fn, - o, wantOps[i]) - return - } - }) - - t.Run("criteria", func(t *testing.T) { - testCases := []struct { - name string - ec Enablement - want bool - }{ - {"nil", 0xff, ptc.et != User}, - {"self", ptc.et, true}, - {"all", EWayland | EX11 | EDBus | EPulse | User | Process, true}, - {"enablements", EWayland | EX11 | EDBus | EPulse, ptc.et != User && ptc.et != Process}, - } - - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - var criteria *Criteria - if tc.ec != 0xff { - criteria = (*Criteria)(&tc.ec) - } - if got := criteria.hasType(o.Type()); got != tc.want { - t.Errorf("hasType: got %v, want %v", - got, tc.want) - } - }) - } - }) - } -} |
