-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See #31
- Loading branch information
Showing
5 changed files
with
119 additions
and
33 deletions.
There are no files selected for viewing
Submodule hugo-bug-reproducibles
added at
734154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package godartsasstesting | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
) | ||
|
||
// IsTest reports whether we're running as a test. | ||
var IsTest bool | ||
|
||
func init() { | ||
for _, arg := range os.Args { | ||
if strings.HasPrefix(arg, "-test.") { | ||
IsTest = true | ||
break | ||
} | ||
} | ||
} | ||
|
||
type PanicWhen uint8 | ||
|
||
func (p PanicWhen) Has(flag PanicWhen) bool { | ||
return p&flag != 0 | ||
} | ||
|
||
func (p PanicWhen) Set(flag PanicWhen) PanicWhen { | ||
return p | flag | ||
} | ||
|
||
const ( | ||
// Used in tests. | ||
ShouldPanicInNewCall PanicWhen = 1 << iota | ||
ShouldPanicInSendInbound1 | ||
ShouldPanicInSendInbound2 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters