package cli_test

import (
	"regexp"
	"testing"
)

func TestCreate(t *testing.T) {
	run(t, []Command{
		{
			"apps",
			"",
		},
		{
			"create acme-inc",
			"Created acme-inc.",
		},
	})
}

func TestApps(t *testing.T) {
	run(t, []Command{
		{
			"create acme-inc",
			"Created acme-inc.",
		},
		{
			"apps",
			"acme-inc      Dec 31 17:01",
		},
	})
}

func TestAppInfo(t *testing.T) {
	regex, err := regexp.Compile("Name: acme-inc\nID:   [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\n")
	if err != nil {
		t.Fatal(err)
	}

	run(t, []Command{
		{
			"create acme-inc",
			"Created acme-inc.",
		},
		{
			"info -a acme-inc",
			regex,
		},
	})
}

package cli_test

import (
	"regexp"
	"testing"
)

func TestCreate(t *testing.T) {
	run(t, []Command{
		{
			"apps",
			"",
		},
		{
			"create acme-inc",
			"Created acme-inc.",
		},
	})
}

func TestApps(t *testing.T) {
	run(t, []Command{
		{
			"create acme-inc",
			"Created acme-inc.",
		},
		{
			"apps",
			"acme-inc      Dec 31 17:01",
		},
	})
}

func TestAppInfo(t *testing.T) {
	run(t, []Command{
		{
			"create acme-inc",
			"Created acme-inc.",
		},
		{
			"info -a acme-inc",
			regexp.MustCompile("Name: acme-inc\nID:   [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\n"),
		},
	})
}

Use regexp.MustCompile() instead of regexp.Compile().
Use regexp.MustCompile() instead of regexp.Compile().