package main

import (
	"database/sql"
	"fmt"
	"strings"

	"github.com/juju/errors"
)

type testcase interface {
	run(db *sql.DB)
	pause()
	resume()
}

type testcaseNames []string

func (tc *testcaseNames) String() string {
	return fmt.Sprint(*tc)
}

func (tc *testcaseNames) Set(value string) error {
	if len(*tc) > 0 {
		return errors.New("testcaseNames already set")
	}

	for _, c := range strings.Split(value, ",") {
		*tc = append(*tc, c)
	}
	return nil
}
