| Index: go/src/infra/libs/git/mode_test.go
|
| diff --git a/go/src/infra/libs/git/mode_test.go b/go/src/infra/libs/git/mode_test.go
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0cc068a8ddc0f30330c8a3643dbb12f2d79c6774
|
| --- /dev/null
|
| +++ b/go/src/infra/libs/git/mode_test.go
|
| @@ -0,0 +1,35 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package git
|
| +
|
| +import (
|
| + "fmt"
|
| + "testing"
|
| +
|
| + . "github.com/smartystreets/goconvey/convey"
|
| +)
|
| +
|
| +func TestMode(t *testing.T) {
|
| + t.Parallel()
|
| +
|
| + cases := map[Mode]ObjectType{
|
| + 0040000: TreeType,
|
| + 0160000: CommitType,
|
| + 0100644: BlobType,
|
| + 0100664: BlobType,
|
| + 0100755: BlobType,
|
| + 0120000: BlobType,
|
| + 0020000: UnknownType,
|
| + }
|
| +
|
| + Convey("Mode", t, func() {
|
| + for mode, typ := range cases {
|
| + mode, typ := mode, typ
|
| + Convey(fmt.Sprintf("Mode(%07o).Type() == %s", int(mode), typ), func() {
|
| + So(mode.Type(), ShouldEqual, typ)
|
| + })
|
| + }
|
| + })
|
| +}
|
|
|