You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following program sample.go triggers an unexpected result
// naming is important because of the way the files are sorted when reading the dir// a.gopackage xx
funcinitializerFunc(xstring) string {
returninitializerMap[x]
}
// b.gopackage xx
vara=initializerFunc("x")
// c.gopackage xx
varinitializerMap=map[string]string{
"x": "y",
}
// b_test.gopackage xx
import"testing"funcTestX(t*testing.T) {
t.Logf(a)
ifa!="y" {
panic("invalid")
}
}
Expected result
$ go test -v .=== RUN TestX b_test.go:6: y--- PASS: TestX (0.00s)PASSok yaegi/tst 0.001s
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.15.1
Additional Notes
Originally discovered by trying to run
yaegi test
on https://github.com/notnil/chess .A caveat is that this bug's behaviour is dependent on the alphabetic ordering of the file. Doing
mv c.go 0.go
leads to the tests succeedingThe text was updated successfully, but these errors were encountered: