Merge pull request #11148 from ahmetalpbalkan/win-cli/chmod-x-fix

pkg/archive: adjust chmod bits on windows
This commit is contained in:
Tibor Vass 2015-03-06 12:28:58 -05:00
commit 0a46fb04bc
5 changed files with 58 additions and 0 deletions

View file

@ -3,6 +3,7 @@
package archive
import (
"os"
"testing"
)
@ -45,3 +46,20 @@ func TestCanonicalTarName(t *testing.T) {
}
}
}
func TestChmodTarEntry(t *testing.T) {
cases := []struct {
in, expected os.FileMode
}{
{0000, 0100},
{0777, 0711},
{0644, 0700},
{0755, 0711},
{0444, 0500},
}
for _, v := range cases {
if out := chmodTarEntry(v.in); out != v.expected {
t.Fatalf("wrong chmod. expected:%v got:%v", v.expected, out)
}
}
}