func (c *TD) FailNow() {
	c.setFailed(true)
	c.fatal = true
	c.T.FailNow()
}
FailNow passes through to testing.T.FailNow
package testdeck
import (
	"fmt"
	"testing"
	"time"
	"github.com/mercari/testdeck/constants"
	"github.com/mercari/testdeck/deferrer"
	"github.com/mercari/testdeck/runner"
)
type TestConfig struct {
	ParallelOff bool
}
type TD struct {
	T                TestingT  
	fatal            bool
	currentLifecycle string
	statuses         []constants.Status  
	timings          map[string]constants.Timing
	actualName       string  
}
type TestCaseDelegate interface {
	ArrangeMethod(t *TD)
	ActMethod(t *TD)
	AssertMethod(t *TD)
	AfterMethod(t *TD)
}
type TestCase struct {
	Arrange                  func(t *TD)  
	Act                      func(t *TD)  
	Assert                   func(t *TD)  
	After                    func(t *TD)  
	deferrer.DefaultDeferrer              
}
func (tc *TestCase) ArrangeMethod(t *TD) {
	timedRun(tc.Arrange, t, constants.LifecycleArrange)
}
func (tc *TestCase) ActMethod(t *TD) {
	timedRun(tc.Act, t, constants.LifecycleAct)
}
func (tc *TestCase) AssertMethod(t *TD) {
	timedRun(tc.Assert, t, constants.LifecycleAssert)
}
func (tc *TestCase) AfterMethod(t *TD) {
	timedRun(tc.After, t, constants.LifecycleAfter)
}
func Test(t TestingT, tc TestCaseDelegate, options ...TestConfig) *TD {
	tagged, matched, actualName := runner.MatchTag(t.Name())
	start := time.Now()
	if runner.Initialized() {
		r := runner.Instance(nil)
		r.LogEvent(fmt.Sprintf("Instantiating: %s", actualName))
	}
	td := &TD{
		T:                t,
		fatal:            false,
		currentLifecycle: constants.LifecycleTestSetup,  
		timings:          make(map[string]constants.Timing),
	}
	if len(options) > 0 {
		if options[0].ParallelOff == false {
			td.T.Parallel()
		}
	} else {
		td.T.Parallel()
	}
	if tagged {
		if !matched {
			if runner.Initialized() {
				r := runner.Instance(nil)
				r.LogEvent("(match workaround) test not in tagged set; skipping")
			}
			return td
		}
		td.actualName = actualName
	}
	arrangeComplete := false
	defer func() {
		end := time.Now()
		if !td.Skipped() || arrangeComplete {
			tc.AfterMethod(td)
		}
		td.currentLifecycle = constants.LifecycleTestFinished
		if len(td.statuses) == 0 {
			td.setPassed()
		} else {
			td.setFailed(td.fatal)
		}
		if d, ok := tc.(deferrer.Deferrer); ok {
			d.RunDeferred()
		}
		if runner.Initialized() {
			r := runner.Instance(nil)
			stats := td.makeStatistics(start, end)
			r.AddStatistics(stats)
		}
	}()
	tc.ArrangeMethod(td)
	arrangeComplete = true
	tc.ActMethod(td)
	tc.AssertMethod(td)
	return td
}
func (c *TD) makeStatistics(start time.Time, end time.Time) *constants.Statistics {
	return &constants.Statistics{
		Name:     c.Name(),
		Failed:   c.Failed(),
		Fatal:    c.fatal,
		Statuses: c.statuses,
		Timings:  c.timings,
		Start:    start,
		End:      end,
		Duration: end.Sub(start),
	}
}
func (c *TD) setPassed() {
	status := constants.Status{
		Status:    constants.StatusPass,
		Lifecycle: c.currentLifecycle,
		Fatal:     false,
	}
	c.statuses = append(c.statuses, status)
}
func (c *TD) setFailed(fatal bool) {
	status := constants.Status{
		Status:    constants.StatusFail,
		Lifecycle: c.currentLifecycle,
		Fatal:     fatal,
	}
	c.statuses = append(c.statuses, status)
}
func (c *TD) setSkipped() {
	status := constants.Status{
		Status:    constants.StatusSkip,
		Lifecycle: c.currentLifecycle,
	}
	c.statuses = append(c.statuses, status)
}
func timedRun(fn func(t *TD), t *TD, lifecycle string) {
	t.currentLifecycle = lifecycle
	timing := constants.Timing{
		Lifecycle: lifecycle,
	}
	timing.Start = time.Now()
	if fn != nil {
		timing.Started = true
		fn(t)  
		timing.Ended = true
	}
	timing.End = time.Now()
	timing.Duration = timing.End.Sub(timing.Start)
	t.timings[timing.Lifecycle] = timing
}
type TestingT interface {
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fail()
	FailNow()
	Failed() bool
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Log(args ...interface{})
	Logf(format string, args ...interface{})
	Name() string
	Skip(args ...interface{})
	SkipNow()
	Skipf(format string, args ...interface{})
	Skipped() bool
	Helper()
	Parallel()
}
func (c *TD) Failed() bool {
	return c.T.Failed()
}
func (c *TD) Log(args ...interface{}) {
	c.T.Log(args...)
}
func (c *TD) Logf(format string, args ...interface{}) {
	c.T.Logf(format, args...)
}
func (c *TD) Name() string {
	if c.actualName != "" {
		return c.actualName
	}
	return c.T.Name()
}
func (c *TD) Helper() {
	c.T.Helper()
}
func (c *TD) Skipped() bool {
	return c.T.Skipped()
}
func (c *TD) Fail() {
	c.setFailed(false)
	c.T.Fail()
}
func (c *TD) Error(args ...interface{}) {
	c.T.Helper()
	c.setFailed(false)
	c.T.Error(args...)
}
func (c *TD) Errorf(format string, args ...interface{}) {
	c.T.Helper()
	c.setFailed(false)
	c.T.Errorf(format, args...)
}
func (c *TD) Fatal(args ...interface{}) {
	c.T.Helper()
	c.setFailed(true)
	c.fatal = true
	c.T.Fatal(args...)
}
func (c *TD) Fatalf(format string, args ...interface{}) {
	c.T.Helper()
	c.setFailed(true)
	c.fatal = true
	c.T.Fatalf(format, args...)
}
func (c *TD) Skip(args ...interface{}) {
	c.setSkipped()
	c.T.Skip(args...)
}
func (c *TD) Skipf(format string, args ...interface{}) {
	c.setSkipped()
	c.T.Skipf(format, args...)
}
func (c *TD) SkipNow() {
	c.setSkipped()
	c.T.SkipNow()
}