]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm/term_test.go
tests: add and use testutil package to reduce duplication
[safcm/safcm.git] / cmd / safcm / term_test.go
index e5faf174c6e43f02603bfdb785154f07ff9eff33..479d7e8e197f7ab951331adec562c6e8671e21e2 100644 (file)
@@ -18,7 +18,7 @@ package main
 import (
        "testing"
 
-       "github.com/google/go-cmp/cmp"
+       "ruderich.org/simon/safcm/testutil"
 )
 
 func TestEscapeControlCharacters(t *testing.T) {
@@ -84,9 +84,7 @@ func TestEscapeControlCharacters(t *testing.T) {
        for _, tc := range tests {
                t.Run(tc.name, func(t *testing.T) {
                        res := EscapeControlCharacters(tc.isTTY, tc.x)
-                       if tc.exp != res {
-                               t.Errorf("res: %s", cmp.Diff(tc.exp, res))
-                       }
+                       testutil.AssertEqual(t, "res", res, tc.exp)
                })
        }
 }