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

import (
	"flag"
	"os"
	"strings"
	"testing"

	"github.com/stretchr/testify/require"
	"github.com/urfave/cli/v2"
)

func TestGetDatabaseUrl(t *testing.T) {
	// set environment variables
	require.NoError(t, os.Setenv("DATABASE_URL", "foo://example.org/one"))
	require.NoError(t, os.Setenv("CUSTOM_URL", "foo://example.org/two"))

	app := NewApp()
	flagset := flag.NewFlagSet(app.Name, flag.Co
    
func TestGetDatabaseUrl(t *testing.T) {
	// set environment variables
	require.NoError(t, os.Setenv("DATABASE_URL", "foo://example.org/one"))
	require.NoError(t, os.Setenv("CUSTOM_URL", "foo://example.org/two"))

	app := NewApp()
	flagset := flag.NewFlagSet(app.Name, flag.ContinueOnError)
	for _, f := range app.Flags {
		require.NoError(t, f.Apply(flagset))
	}
	ctx := cli.NewContext(app, flagset, nil)

	// no flags defaults to DATABASE_URL
	u, err := getDatabaseURL(ctx)
	require.NoError(t, err)
	require.Equal(t, "foo://example.org/one", u.String())

	// --env overwrites DATABASE_URL
	require.NoError(t, ctx.Set("env", "CUSTOM_URL"))
	u, err = getDatabaseURL(ctx)
	require.NoError(t, err)
	require.Equal(t, "foo://example.org/two", u.String())

	// --url takes precedence over preceding two options
	require.NoError(t, ctx.Set("url", "foo://example.org/three"))
	u, err = getDatabaseURL(ctx)
	require.NoError(t, err)
	require.Equal(t, "foo://example.org/three", u.String())
}