1
0
mirror of https://github.com/golang/go synced 2024-11-20 05:54:43 -07:00

fix to scanner_test after change to //-style comment token

R=rsc
OCL=31421
CL=31421
This commit is contained in:
Robert Griesemer 2009-07-09 16:54:08 -07:00
parent ee5fe7756f
commit f7b92bb45d

View File

@ -221,6 +221,11 @@ func TestScan(t *testing.T) {
} }
eloc.Offset += len(lit) + len(whitespace); eloc.Offset += len(lit) + len(whitespace);
eloc.Line += NewlineCount(lit) + whitespace_linecount; eloc.Line += NewlineCount(lit) + whitespace_linecount;
if tok == token.COMMENT && litb[1] == '/' {
// correct for unaccounted '/n' in //-style comment
eloc.Offset++;
eloc.Line++;
}
index++; index++;
return tok != token.EOF; return tok != token.EOF;
} }