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

import (
	"testing"

	qt "github.com/frankban/quicktest"
)

func Test_discoverServices(t *testing.T) {
	tests := []struct {
		name         string
		txtar        string
		wantServices []string
		wantErrors   []string
	}{
		// Happy Path Tests
		{
			name: "services defined by APIs",
			txtar: `
-- systemA/svc1/foo.go --
package svc1

import "context"

//encore:api public
func Foo(ctx context.Context) error { return nil }

-- systemA/svc2/bar.go --
package svc2

import "context"

//encore:api public
func Bar(ctx context.Context) error { return nil }

-- svc3/bar.go --
package svc3

import "context"

//encore:api public
func Bar(ctx context.Context) error { return nil }
`,
			wantServices: []string{"svc1", "svc2", "svc3"},
		},
		{
			name: "services defined by service structs",
			txtar: `
-- svc1/foo.go --
package svc1

import "context"

//encore:
    
func initBar() (*Bar, error) { return nil, nil }
`,
			wantErrors: []string{"The service svc2 was found within the service svc1. Encore does not allow services to be nested"},
		},
	}
	for _, tt := range tests {
		tt := tt
		t.Run(tt.name, func(t *testing.T) {
			t.Parallel()
			c := qt.New(t)

			ctx, result := Parse(c, tt.txtar)

			services := discoverServices(ctx.Context, result)

			if len(tt.wantErrors) > 0 {
				for _, s := range services {
					c.Logf("got service: %s (%s)", s.Name, s.FSRoot)
				}
				ctx.DeferExpectError(tt.wantErrors...)
			} else {
				ctx.FailTestOnErrors()

				wanted := make(map[string]struct{})
				for _, s := range tt.wantServices {
					wanted[s] = struct{}{}
				}

				for _, s := range services {
					if _, ok := wanted[s.Name]; !ok {
						c.Errorf("unexpected service %q", s.Name)
					}
					delete(wanted, s.Name)
				}

				for s := range wanted {
					c.Errorf("missing service %q", s)
				}
			}

		})
	}
}