1
0
mirror of https://github.com/golang/go synced 2024-10-03 22:31:21 -06:00
go/usr/gri/pretty/selftest.go
Robert Griesemer e45eb60657 Added mechanism for very precise self-testing:
- in selftest mode (-t) interpret comments of the form /* ERROR */ and /* SYNC */
  and validate reported errors with the error markings in a file
- added initial selftest.go file

Also:
- fixed an issue with empty blocks
- generally report better error messages
- added many more tests to the test script (essentially all .go programs which
  have no syntax errors)

R=r
OCL=17426
CL=17426
2008-10-18 16:42:25 -07:00

33 lines
548 B
Go

// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import P0 /* ERROR expected */ ; /* SYNC */
import P1 /* ERROR expected */ Flags /* SYNC */
import P2 /* ERROR expected */ 42 /* SYNC */
type S0 struct {
f0, f1, f2;
}
func /* ERROR receiver */ () f0() {} /* SYNC */
func /* ERROR receiver */ (*S0, *S0) f1() {} /* SYNC */
func f0(a b, c /* ERROR type */ ) {}
func f1() {
}
func main () {
}
func /* ERROR EOF */