Beispiel #1
0
func Test_main(t *testing.T) {
	defer teardown()
	setup()
	addToArgs("-f=input.go")
	expected := "someFieldToPrint someOtherField|8,16,stringToPrint a b|18,21,a"

	main()

	assertStringEqual(t, "Should have parsed input.go correctly", expected, testutils.GetLastPrinted())
}
Beispiel #2
0
func Test_main_shouldPrintErrorOnPanic(t *testing.T) {
	defer teardown()
	setup()
	addToArgs("-f=error.go")
	fmt.Println(os.Args)
	expected := ""

	main()

	assertStringEqual(t, "Should have parsed input.go correctly", expected, testutils.GetLastPrinted())
}