Closed
Description
I have a test file which attempts to read a file from disk. When gopherjs has not been configured to support syscalls, this leads to a 'permission denied' error, but the test suite still passes:
$ gopherjs test
gopherjs: Source maps disabled. Use Node.js 4.x with source-map-support module for nice stack traces.
warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md
--- FAIL: TestFile (0.02s)
test.607290009:23615: Error opening file: open foobarbaz: permission denied
FAIL
ok github.com/flimzy/jstest 0.326s
My test file:
package main
import (
"io/ioutil"
"testing"
)
func TestFile(t *testing.T) {
_, err := ioutil.ReadFile("foobarbaz")
t.Fatalf("Error opening file: %s", err)
}
I'm not sure what could possibly be causing this (why should t.Fatalf()
care that syscalls are unsupported?), so I'm not entirely sure it's a problem with gopherjs.
I discovered this problem when some Travis CI tests were passing, despite the error message shown above.