"os"
"path/filepath"
"regexp"
+ "sort"
"strings"
"testing"
return
}
+ // sort errlist in source order
+ sort.Slice(errlist, func(i, j int) bool {
+ pi := unpackError(errlist[i]).Pos
+ pj := unpackError(errlist[j]).Pos
+ return pi.Cmp(pj) < 0
+ })
+
// collect expected errors
errmap := make(map[string]map[uint][]syntax.Error)
for _, filename := range filenames {
}
// match against found errors
- // TODO(gri) sort err list to avoid mismatched when having multiple errors
for _, err := range errlist {
got := unpackError(err)
// eliminate from list
if n := len(list) - 1; n > 0 {
- // not the last entry - swap in last element and shorten list by 1
- // TODO(gri) avoid changing the order of entries
- list[index] = list[n]
+ // not the last entry - slide entries down (don't reorder)
+ copy(list[index:], list[index+1:])
filemap[line] = list[:n]
} else {
// last entry - remove list from filemap
func _() { var _ = new(foo9 /* ERROR interface contains type constraints */ [int]) }
// crash 12
-// TODO(gri) temporarily disabled due to an error check issue
-// var u /* ERROR cycle */ , i [func /* ERROR used as value */ /* ERROR used as value */ (u, c /* ERROR undeclared */ /* ERROR undeclared */ ) {}(0, len)]c /* ERROR undeclared */ /* ERROR undeclared */
+var u /* ERROR cycle */ , i [func /* ERROR used as value */ /* ERROR used as value */ (u, c /* ERROR undeclared */ /* ERROR undeclared */ ) {}(0, len /* ERROR must be called */ /* ERROR must be called */ )]c /* ERROR undeclared */ /* ERROR undeclared */
// crash 15
func y15() { var a /* ERROR declared but not used */ interface{ p() } = G15[string]{} }