According to POSIX.1-2008: "When a file is to be read or written, the file shall be opened with an access mode corresponding to the operation to be performed. If file access permissions deny access, the requested operation shall fail." However, if a filesystem is mounted R/O, then the "root can write to any file" assumption (coreutils/test.c#603) fails, and test -w returns true even if the file is not actually writeable. This differs from the behaviour of bash, which correctly returns false.