Commit 5e5d4575 authored by Tommi Virtanen's avatar Tommi Virtanen

flatfs: Don't test file modes on Windows

parent e7adebaa
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"runtime"
"testing" "testing"
"github.com/jbenet/go-datastore" "github.com/jbenet/go-datastore"
...@@ -182,8 +183,10 @@ func TestStorage(t *testing.T) { ...@@ -182,8 +183,10 @@ func TestStorage(t *testing.T) {
if !fi.Mode().IsRegular() { if !fi.Mode().IsRegular() {
t.Errorf("expected a regular file, mode: %04o", fi.Mode()) t.Errorf("expected a regular file, mode: %04o", fi.Mode())
} }
if g, e := fi.Mode()&os.ModePerm&0007, os.FileMode(0000); g != e { if runtime.GOOS != "windows" {
t.Errorf("file should not be world accessible: %04o", fi.Mode()) if g, e := fi.Mode()&os.ModePerm&0007, os.FileMode(0000); g != e {
t.Errorf("file should not be world accessible: %04o", fi.Mode())
}
} }
default: default:
t.Errorf("saw unexpected directory entry: %q %v", path, fi.Mode()) t.Errorf("saw unexpected directory entry: %q %v", path, fi.Mode())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment