aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/matrix/matrix_test.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 4938ba9..6ec41bd 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -896,11 +896,19 @@ func TestChmod(t *testing.T) {
file.Close()
modes := []os.FileMode{0777, 0707, 0606, 0666, 0444, 0000, 0111, 0123, 0321}
for _, modeWant := range modes {
- os.Chmod(path, modeWant)
fi, err := os.Stat(path)
if err != nil {
t.Fatal(err)
}
+ err = syscall.Chmod(path, uint32(modeWant))
+ if err != nil {
+ t.Errorf("chmod %03o -> %03o failed: %v", fi.Mode(), modeWant, err)
+ continue
+ }
+ fi, err = os.Stat(path)
+ if err != nil {
+ t.Fatal(err)
+ }
modeHave := fi.Mode()
if modeHave != modeWant {
t.Errorf("modeHave %#o != modeWant %#o", modeHave, modeWant)