On Saturday, February 4, 2017 at 5:59:34 PM UTC-5, Tong Sun wrote: > > I know all go testing code are invoked with "*go test*", however, I want > to easily test out some of the test code of the package I'm trying, so the > easiest way is to test them out as-is, but with "*go run*" instead. Is it > possible, or how can I make such thing possible? > > For e.g., here is a piece of test code I that want to test out (just for > illustration), > > func TestSomething(t *testing.T) { > fmt.Println("Say hi") > t.Log("Say bye") > t.Error("Error is equivalent to Log followed by Fail") > } > > > and I want to test out in my own program like this: > > package main > func main() { > } > > > how can I make it possible? >
FTA, https://github.com/suntong/lang/blob/master/lang/Go/src/HelloTest.go Extremely hacky. Any better solution? Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.