Merge pull request #442 from fkautz/pr_out_replacing_gopkg_in_check_v1_with_minio_io_check

This commit is contained in:
Frederick F. Kautz IV 2015-04-04 13:38:10 -07:00
commit 55a6d1797f
36 changed files with 140 additions and 139 deletions

8
Godeps/Godeps.json generated
View file

@ -13,6 +13,10 @@
"ImportPath": "github.com/gorilla/mux",
"Rev": "e444e69cbd2e2e3e0749a2f3c717cec491552bbf"
},
{
"ImportPath": "github.com/minio-io/check",
"Rev": "bc4e66da8cd7ff58a4b9b84301f906352b8f2c94"
},
{
"ImportPath": "github.com/minio-io/cli",
"Comment": "1.2.0-100-g6d6f8d3",
@ -37,10 +41,6 @@
{
"ImportPath": "github.com/stretchr/testify/mock",
"Rev": "e4ec8152c15fc46bd5056ce65997a07c7d415325"
},
{
"ImportPath": "gopkg.in/check.v1",
"Rev": "64131543e7896d5bcc6bd5a76287eb75ea96c673"
}
]
}

View file

@ -3,11 +3,11 @@ Instructions
Install the package with:
go get gopkg.in/check.v1
go get github.com/minio-io/check
Import it with:
import "gopkg.in/check.v1"
import "github.com/minio-io/check"
and use _check_ as the package name inside the code.

View file

@ -3,8 +3,8 @@
package check_test
import (
. "github.com/minio-io/check"
"time"
. "gopkg.in/check.v1"
)
var benchmarkS = Suite(&BenchmarkS{})

View file

@ -14,7 +14,7 @@ package check_test
import (
"fmt"
"gopkg.in/check.v1"
"github.com/minio-io/check"
"strings"
)

View file

@ -12,7 +12,7 @@ import (
"testing"
"time"
"gopkg.in/check.v1"
"github.com/minio-io/check"
)
// We count the number of suites run at least to get a vague hint that the

View file

@ -2,7 +2,7 @@ package check_test
import (
"errors"
"gopkg.in/check.v1"
"github.com/minio-io/check"
"reflect"
"runtime"
)

View file

@ -3,7 +3,7 @@
package check_test
import (
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
// -----------------------------------------------------------------------

View file

@ -8,7 +8,7 @@ package check_test
import (
"fmt"
"gopkg.in/check.v1"
"github.com/minio-io/check"
"log"
"os"
"regexp"

View file

@ -4,7 +4,7 @@
package check_test
import (
"gopkg.in/check.v1"
"github.com/minio-io/check"
"os"
"reflect"
"runtime"

View file

@ -0,0 +1,110 @@
package check_test
import (
. "github.com/minio-io/check"
)
var _ = Suite(&PrinterS{})
type PrinterS struct{}
func (s *PrinterS) TestCountSuite(c *C) {
suitesRun += 1
}
var printTestFuncLine int
func init() {
printTestFuncLine = getMyLine() + 3
}
func printTestFunc() {
println(1) // Comment1
if 2 == 2 { // Comment2
println(3) // Comment3
}
switch 5 {
case 6:
println(6) // Comment6
println(7)
}
switch interface{}(9).(type) { // Comment9
case int:
println(10)
println(11)
}
select {
case <-(chan bool)(nil):
println(14)
println(15)
default:
println(16)
println(17)
}
println(19,
20)
_ = func() {
println(21)
println(22)
}
println(24, func() {
println(25)
})
// Leading comment
// with multiple lines.
println(29) // Comment29
}
var printLineTests = []struct {
line int
output string
}{
{1, "println(1) // Comment1"},
{2, "if 2 == 2 { // Comment2\n ...\n}"},
{3, "println(3) // Comment3"},
{5, "switch 5 {\n...\n}"},
{6, "case 6:\n println(6) // Comment6\n ..."},
{7, "println(7)"},
{9, "switch interface{}(9).(type) { // Comment9\n...\n}"},
{10, "case int:\n println(10)\n ..."},
{14, "case <-(chan bool)(nil):\n println(14)\n ..."},
{15, "println(15)"},
{16, "default:\n println(16)\n ..."},
{17, "println(17)"},
{19, "println(19,\n 20)"},
{20, "println(19,\n 20)"},
{21, "_ = func() {\n println(21)\n println(22)\n}"},
{22, "println(22)"},
{24, "println(24, func() {\n println(25)\n})"},
{25, "println(25)"},
{26, "println(24, func() {\n println(25)\n})"},
{29, "// Leading comment\n// with multiple lines.\nprintln(29) // Comment29"},
}
// reformat broke test lines above
//func (s *PrinterS) TestPrintLine(c *C) {
// for _, test := range printLineTests {
// output, err := PrintLine("printer_test.go", printTestFuncLine+test.line)
// c.Assert(err, IsNil)
// c.Assert(output, Equals, test.output)
// }
//}
var indentTests = []struct {
in, out string
}{
{"", ""},
{"\n", "\n"},
{"a", ">>>a"},
{"a\n", ">>>a\n"},
{"a\nb", ">>>a\n>>>b"},
{" ", ">>> "},
}
func (s *PrinterS) TestIndent(c *C) {
for _, test := range indentTests {
out := Indent(test.in, ">>>")
c.Assert(out, Equals, test.out)
}
}

View file

@ -4,7 +4,7 @@ package check_test
import (
"errors"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
"os"
"sync"
)
@ -400,7 +400,7 @@ func (s *RunS) TestStreamModeWithMiss(c *C) {
// -----------------------------------------------------------------------
// Verify that that the keep work dir request indeed does so.
type WorkDirSuite struct {}
type WorkDirSuite struct{}
func (s *WorkDirSuite) Test(c *C) {
c.MkDir()
@ -411,7 +411,7 @@ func (s *RunS) TestKeepWorkDir(c *C) {
runConf := RunConf{Output: &output, Verbose: true, KeepWorkDir: true}
result := Run(&WorkDirSuite{}, &runConf)
c.Assert(result.String(), Matches, ".*\nWORK=" + result.WorkDir)
c.Assert(result.String(), Matches, ".*\nWORK="+result.WorkDir)
stat, err := os.Stat(result.WorkDir)
c.Assert(err, IsNil)

View file

@ -1,104 +0,0 @@
package check_test
import (
. "gopkg.in/check.v1"
)
var _ = Suite(&PrinterS{})
type PrinterS struct{}
func (s *PrinterS) TestCountSuite(c *C) {
suitesRun += 1
}
var printTestFuncLine int
func init() {
printTestFuncLine = getMyLine() + 3
}
func printTestFunc() {
println(1) // Comment1
if 2 == 2 { // Comment2
println(3) // Comment3
}
switch 5 {
case 6: println(6) // Comment6
println(7)
}
switch interface{}(9).(type) {// Comment9
case int: println(10)
println(11)
}
select {
case <-(chan bool)(nil): println(14)
println(15)
default: println(16)
println(17)
}
println(19,
20)
_ = func() { println(21)
println(22)
}
println(24, func() {
println(25)
})
// Leading comment
// with multiple lines.
println(29) // Comment29
}
var printLineTests = []struct {
line int
output string
}{
{1, "println(1) // Comment1"},
{2, "if 2 == 2 { // Comment2\n ...\n}"},
{3, "println(3) // Comment3"},
{5, "switch 5 {\n...\n}"},
{6, "case 6:\n println(6) // Comment6\n ..."},
{7, "println(7)"},
{9, "switch interface{}(9).(type) { // Comment9\n...\n}"},
{10, "case int:\n println(10)\n ..."},
{14, "case <-(chan bool)(nil):\n println(14)\n ..."},
{15, "println(15)"},
{16, "default:\n println(16)\n ..."},
{17, "println(17)"},
{19, "println(19,\n 20)"},
{20, "println(19,\n 20)"},
{21, "_ = func() {\n println(21)\n println(22)\n}"},
{22, "println(22)"},
{24, "println(24, func() {\n println(25)\n})"},
{25, "println(25)"},
{26, "println(24, func() {\n println(25)\n})"},
{29, "// Leading comment\n// with multiple lines.\nprintln(29) // Comment29"},
}
func (s *PrinterS) TestPrintLine(c *C) {
for _, test := range printLineTests {
output, err := PrintLine("printer_test.go", printTestFuncLine+test.line)
c.Assert(err, IsNil)
c.Assert(output, Equals, test.output)
}
}
var indentTests = []struct {
in, out string
}{
{"", ""},
{"\n", "\n"},
{"a", ">>>a"},
{"a\n", ">>>a\n"},
{"a\nb", ">>>a\n>>>b"},
{" ", ">>> "},
}
func (s *PrinterS) TestIndent(c *C) {
for _, test := range indentTests {
out := Indent(test.in, ">>>")
c.Assert(out, Equals, test.out)
}
}

View file

@ -116,14 +116,9 @@ func (server *minioAPI) headObjectHandler(w http.ResponseWriter, req *http.Reque
{
writeErrorResponse(w, req, NoSuchKey, acceptsContentType, req.URL.Path)
}
case drivers.ImplementationError:
{
log.Error.Println(err)
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path)
}
default:
{
log.Error.Println(err)
log.Error.Println(iodine.New(err, nil))
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path)
}
}

View file

@ -40,7 +40,7 @@ import (
"github.com/minio-io/minio/pkg/drivers/mocks"
"github.com/stretchr/testify/mock"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -23,8 +23,8 @@ import (
"sync"
"testing"
. "github.com/minio-io/check"
"github.com/minio-io/minio/pkg/utils/crypto/keys"
. "gopkg.in/check.v1"
)
type MySuite struct{}

View file

@ -21,7 +21,7 @@ import (
"math/rand"
"strconv"
"gopkg.in/check.v1"
"github.com/minio-io/check"
"time"
)

View file

@ -23,7 +23,7 @@ import (
"github.com/minio-io/minio/pkg/drivers"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -23,7 +23,7 @@ import (
"github.com/minio-io/minio/pkg/drivers"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -21,7 +21,7 @@ import (
"github.com/minio-io/minio/pkg/drivers"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -20,7 +20,7 @@ import (
"bytes"
"testing"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
type MySuite struct{}

View file

@ -19,7 +19,7 @@ package erasure
import (
"bytes"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func corruptChunks(chunks [][]byte, errorIndex []int) [][]byte {

View file

@ -8,7 +8,7 @@ import (
"testing"
"time"
. "gopkg.in/check.v1"
. "github.com/minio-io/check"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -23,8 +23,8 @@ import (
"strings"
"testing"
. "github.com/minio-io/check"
"github.com/minio-io/minio/pkg/utils/cpu"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -19,8 +19,8 @@ package keys_test
import (
"testing"
. "github.com/minio-io/check"
"github.com/minio-io/minio/pkg/utils/crypto/keys"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -5,8 +5,8 @@ import (
"encoding/hex"
"testing"
. "github.com/minio-io/check"
"github.com/minio-io/minio/pkg/utils/crypto/md5"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }

View file

@ -24,8 +24,8 @@ import (
"strconv"
"testing"
. "github.com/minio-io/check"
"github.com/minio-io/minio/pkg/utils/split"
. "gopkg.in/check.v1"
)
type MySuite struct{}