From a47b35dc44f0e770a1bb1f7b53b6aa11d6895e0b Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 26 Feb 2020 16:28:57 +0000 Subject: Fix flag parsing with go test, and switch to -short to gate long tests --- init_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 init_test.go (limited to 'init_test.go') diff --git a/init_test.go b/init_test.go new file mode 100644 index 0000000..37e510b --- /dev/null +++ b/init_test.go @@ -0,0 +1,19 @@ +// Copyright 2019 Nick White. +// Use of this source code is governed by the GPLv3 +// license that can be found in the LICENSE file. + +package preproc + +import ( + "flag" + "os" + "testing" +) + +var update = flag.Bool("update", false, "update golden files") + +// TestMain is needed to ensure flags are parsed +func TestMain(m *testing.M) { + flag.Parse() + os.Exit(m.Run()) +} -- cgit v1.2.1-24-ge1ad