You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: source_cache_bolt_encode_test.go
    path of file: ./repos/dep/gps
    
    the code of the file until where you have to start completion: // Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package gps

import (
	"bytes"
	"testing"
	"time"

	"github.com/golang/protobuf/proto"
)

func TestPropertiesFromCache(t *testing.T) {
	for _, test := range []struct {
		name string
		ip   ProjectRoot
		pp   ProjectProperties
	}{
		{"defaultBranch",
			"root", ProjectProperties{"", newDefaultBranch("test")}},
		{"branch",
			"root", ProjectProperties{"source", NewBranch("test")}},
		{"semver",
			"root", ProjectProperties{"", testSemverConstraint(t, "^1.0.0")}},
		{"rev",
			"root", ProjectProperties{"source", Revision("test")}},
		{"any",
			"root", ProjectProperties{"source", Any()}},
	} {
		t.Run(test.name, func(t *testing.T) {
			var buf projectPropertiesMsgs
			buf.copyFrom(test.ip, test.pp)
			v, err := proto.Marshal(&buf.pp)
			if err != nil {
				t.Fatal(err)
			}

			if err := proto.Unmarshal(v, &buf.pp
    
func TestPropertiesFromCache(t *testing.T) {
	for _, test := range []struct {
		name string
		ip   ProjectRoot
		pp   ProjectProperties
	}{
		{"defaultBranch",
			"root", ProjectProperties{"", newDefaultBranch("test")}},
		{"branch",
			"root", ProjectProperties{"source", NewBranch("test")}},
		{"semver",
			"root", ProjectProperties{"", testSemverConstraint(t, "^1.0.0")}},
		{"rev",
			"root", ProjectProperties{"source", Revision("test")}},
		{"any",
			"root", ProjectProperties{"source", Any()}},
	} {
		t.Run(test.name, func(t *testing.T) {
			var buf projectPropertiesMsgs
			buf.copyFrom(test.ip, test.pp)
			v, err := proto.Marshal(&buf.pp)
			if err != nil {
				t.Fatal(err)
			}

			if err := proto.Unmarshal(v, &buf.pp); err != nil {
				t.Fatal(err)
			} else {
				ip, pp, err := propertiesFromCache(&buf.pp)
				if err != nil {
					t.Fatal(err)
				}
				if ip != test.ip {
					t.Errorf("decoded unexpected ProjectRoot:\n\t(GOT): %#v\n\t(WNT): %#v", ip, test.ip)
				}
				if pp.Source != test.pp.Source {
					t.Errorf("decoded unexpected ProjectRoot.Source:\n\t(GOT): %s\n\t (WNT): %s", pp.Source, test.pp.Source)
				}
				if !pp.Constraint.identical(test.pp.Constraint) {
					t.Errorf("decoded non-identical ProjectRoot.Constraint:\n\t(GOT): %#v\n\t(WNT): %#v", pp.Constraint, test.pp.Constraint)
				}
			}
		})
	}
}