secure/precis: make byte copy test a subtest

Previously if any subtests were failing and the copy test (which was
part of the root test function) also failed its output got mixed up with
that of the last subtest which failed.

Change-Id: I9c538d54253d9f347033de0fa7a7a184bf3ccfab
Reviewed-on: https://go-review.googlesource.com/69295
Run-TryBot: Sam Whited <sam@samwhited.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/secure/precis/enforce_test.go b/secure/precis/enforce_test.go
index b546627..126a2d7 100644
--- a/secure/precis/enforce_test.go
+++ b/secure/precis/enforce_test.go
@@ -279,13 +279,16 @@
 			t.Errorf("got %+q (err: %v); want %+q (err: %v)", string(e), err, tc.output, tc.err)
 		}
 	})
-	// Test that calling Bytes with something that doesn't transform returns a
-	// copy.
-	orig := []byte("hello")
-	b, _ := NewFreeform().Bytes(orig)
-	if reflect.ValueOf(b).Pointer() == reflect.ValueOf(orig).Pointer() {
-		t.Error("original and result are the same slice; should be a copy")
-	}
+
+	t.Run("Copy", func(t *testing.T) {
+		// Test that calling Bytes with something that doesn't transform returns a
+		// copy.
+		orig := []byte("hello")
+		b, _ := NewFreeform().Bytes(orig)
+		if reflect.ValueOf(b).Pointer() == reflect.ValueOf(orig).Pointer() {
+			t.Error("original and result are the same slice; should be a copy")
+		}
+	})
 }
 
 func TestAppend(t *testing.T) {