]> Cypherpunks repositories - gostls13.git/commitdiff
fix to scanner_test after change to //-style comment token
authorRobert Griesemer <gri@golang.org>
Thu, 9 Jul 2009 23:54:08 +0000 (16:54 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 9 Jul 2009 23:54:08 +0000 (16:54 -0700)
R=rsc
OCL=31421
CL=31421

src/pkg/go/scanner/scanner_test.go

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