| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package git |
| 6 |
| 7 import ( |
| 8 "fmt" |
| 9 "testing" |
| 10 |
| 11 . "github.com/smartystreets/goconvey/convey" |
| 12 ) |
| 13 |
| 14 func TestMode(t *testing.T) { |
| 15 t.Parallel() |
| 16 |
| 17 cases := map[Mode]ObjectType{ |
| 18 0040000: TreeType, |
| 19 0160000: CommitType, |
| 20 0100644: BlobType, |
| 21 0100664: BlobType, |
| 22 0100755: BlobType, |
| 23 0120000: BlobType, |
| 24 0020000: UnknownType, |
| 25 } |
| 26 |
| 27 Convey("Mode", t, func() { |
| 28 for mode, typ := range cases { |
| 29 mode, typ := mode, typ |
| 30 Convey(fmt.Sprintf("Mode(%07o).Type() == %s", int(mode),
typ), func() { |
| 31 So(mode.Type(), ShouldEqual, typ) |
| 32 }) |
| 33 } |
| 34 }) |
| 35 } |
| OLD | NEW |