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: update_test.go
    path of file: ./repos/evans/app
    
    the code of the file until where you have to start completion: package app

import (
	"bytes"
	"context"
	"fmt"
	"io"
	"testing"
	"time"

	"github.com/google/go-cmp/cmp"
	"github.com/hashicorp/go-version"
	"github.com/ktr0731/evans/cache"
	"github.com/ktr0731/evans/config"
	"github.com/ktr0731/evans/meta"
	"github.com/ktr0731/evans/prompt"
	"github.com/ktr0731/go-updater"
	"github.com/ktr0731/go-updater/github"
	"github.com/pkg/errors"
)

type dummyMeans struct {
	dummyMeansBuilderOption

	updater.Means
}

func (m *dummyMeans) Installed(context.Context) bool {
	return m.installed
}

func (m *dummyMeans) Type() updater.MeansType {
	return updater.MeansType(m.typeName)
}

func (m *dummyMeans) LatestTag(context.Context) (*version.Version, error) {
	return version.NewSemver(m.version)
}

func (m *dummyMeans) Update(context.Context, *version.Version) error {
	time.Sleep(50 * time.Millisecond)
	return nil
}

type dummyMeansBuilderOption struct {
	// If err is nil, dummyMeansBuilder returns it as an error.
	err error

	/
    
func Test_processUpdate(t *testing.T) {
	oldMeans := means
	defer func() {
		means = oldMeans
	}()

	oldSyscallExec := syscallExec
	defer func() {
		syscallExec = oldSyscallExec
	}()
	syscallExec = func(argv0 string, argv []string, envv []string) (err error) { return nil }

	oldVersion := meta.Version
	meta.Version = version.Must(version.NewSemver("0.1.0"))
	defer func() {
		meta.Version = oldVersion
	}()

	cases := map[string]struct {
		cache *cache.Cache

		cfgMeta config.Meta

		selectResult    bool
		selectResultErr error
	}{
		"prompt returns yes": {
			cache: &cache.Cache{
				SaveFunc: func() error { return nil },
				UpdateInfo: cache.UpdateInfo{
					InstalledBy:   cache.MeansType(github.MeansTypeGitHubRelease),
					LatestVersion: "0.2.0",
				},
				Version: "0.1.0",
			},
			cfgMeta: config.Meta{
				UpdateLevel: "patch",
			},
			selectResult: true,
		},
		"prompt returns false": {
			cache: &cache.Cache{
				UpdateInfo: cache.UpdateInfo{
					InstalledBy:   cache.MeansType(github.MeansTypeGitHubRelease),
					LatestVersion: "0.2.0",
				},
				Version: "0.1.0",
			},
			cfgMeta: config.Meta{
				UpdateLevel: "patch",
			},
			selectResult: false,
		},
		"abort if prompt returns an error": {
			cache: &cache.Cache{
				UpdateInfo: cache.UpdateInfo{
					InstalledBy:   cache.MeansType(github.MeansTypeGitHubRelease),
					LatestVersion: "0.2.0",
				},
				Version: "0.1.0",
			},
			cfgMeta: config.Meta{
				UpdateLevel: "patch",
			},
			selectResult:    false,
			selectResultErr: errors.New("an error"),
		},
		"do nothing if cached version <= the current version": {
			cache: &cache.Cache{
				SaveFunc: func() error { return nil },
				UpdateInfo: cache.UpdateInfo{
					InstalledBy:   cache.MeansType(github.MeansTypeGitHubRelease),
					LatestVersion: "0.0.1",
				},
				Version: "0.1.0",
			},
			cfgMeta: config.Meta{
				UpdateLevel: "patch",
			},
			selectResult: false,
		},
		"AutoUpdate enabled": {
			cache: &cache.Cache{
				SaveFunc: func() error { return nil },
				UpdateInfo: cache.UpdateInfo{
					InstalledBy:   cache.MeansType(github.MeansTypeGitHubRelease),
					LatestVersion: "0.2.0",
				},
				Version: "0.1.0",
			},
			cfgMeta: config.Meta{
				AutoUpdate:  true,
				UpdateLevel: "patch",
			},
			selectResult: false,
		},
	}
	for name, c := range cases {
		c := c
		t.Run(name, func(t *testing.T) {
			means = map[updater.MeansType]updater.MeansBuilder{
				// Assign a dummy means builder as the GitHub Releases means.
				github.MeansTypeGitHubRelease: dummyMeansBuilder(dummyMeansBuilderOption{
					installed: true,
					typeName:  string(c.cache.UpdateInfo.InstalledBy),
					version:   c.cache.UpdateInfo.LatestVersion,
				}),
			}

			var result string
			if c.selectResult {
				result = "yes"
			} else {
				result = "no"
			}
			p := &promptMock{result: result, err: c.selectResultErr}

			var buf bytes.Buffer
			if err := processUpdate(context.Background(), &config.Config{Meta: &c.cfgMeta}, &buf, c.cache, p); err != nil {
				t.Errorf("must not return an error, but got '%s'", err)
			}
		})
	}
}