1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00

Fix test cases where cp and mirror would fail

- globalQuietFlag and globalJSONFlag should be checked in conjunction
  for terminal features to be disabled. Otherwise ioctl fails for
  calculating the term size.

- Avoid unnecessary scoping for probe, it has two different error sets now
This commit is contained in:
Harshavardhana
2015-08-12 22:11:29 -07:00
parent e2c4d25e86
commit 99f53fe45d
6 changed files with 65 additions and 54 deletions

View File

@@ -35,9 +35,12 @@ var NoDebugPrint = true
// IsTesting this flag indicates if IsExited should be set or not, false by default
var IsTesting = false
// IsExited sets this boolean value if Fatal is called instead of os.Exit(1)
// IsExited sets this boolean value if Fatal is called when IsTestng is enabled
var IsExited = false
// IsError sets this boolean value if Error is called when IsTesting is enabled
var IsError = false
// Theme holds console color scheme
type Theme struct {
Fatal *color.Color
@@ -139,7 +142,7 @@ var (
Error = func(data ...interface{}) {
if IsTesting {
defer func() {
IsExited = true
IsError = true
}()
}
print(themesDB[currThemeName].Error, data...)
@@ -150,7 +153,7 @@ var (
Errorf = func(f string, data ...interface{}) {
if IsTesting {
defer func() {
IsExited = true
IsError = true
}()
}
printf(themesDB[currThemeName].Error, f, data...)
@@ -161,7 +164,7 @@ var (
Errorln = func(data ...interface{}) {
if IsTesting {
defer func() {
IsExited = true
IsError = true
}()
}
println(themesDB[currThemeName].Error, data...)