Skip to content

Commit

Permalink
Fix mflag test issue with "ResetForTesting" (which only showed up und…
Browse files Browse the repository at this point in the history
…er dyntest for some odd reason)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
  • Loading branch information
tianon committed Jan 23, 2014
1 parent 7687b3c commit f60eee4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
17 changes: 0 additions & 17 deletions pkg/mflag/export_test.go

This file was deleted.

7 changes: 7 additions & 0 deletions pkg/mflag/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ import (
"time"
)

// ResetForTesting clears all flag state and sets the usage function as directed.
// After calling ResetForTesting, parse errors in flag handling will not
// exit the program.
func ResetForTesting(usage func()) {
CommandLine = NewFlagSet(os.Args[0], ContinueOnError)
Usage = usage
}
func boolString(s string) string {
if s == "0" {
return "false"
Expand Down

0 comments on commit f60eee4

Please sign in to comment.