Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Issue 6031049: code review 6031049: exp/html: more comprehensive tests (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 7 months ago by andybalholm
Modified:
14 years, 7 months ago
Reviewers:
CC:
nigeltao, golang-dev
Visibility:
Public.

Description

exp/html: more comprehensive tests Currently, the html package only runs a limited subset of the tests in the testdata directory. This tends to limit development of the parser to fixing the bug that causes the first failing test. This CL gives it the ability to run all the tests and produce a log showing the status of each test. (It does it when tests are run with 'go test --update-logs') The status is listed as PASS, FAIL, or PARSE (PARSE means that parsing produced the correct tree, but rendering and re-parsing does not produce the same tree). When 'go test' is run without --update-logs, it runs the tests marked 'PASS' in the logs (and the parsing portion of the tests marked 'PARSE'). Thus it will fail if there has been a regression since the last time the logs were updated. My goal for this CL is to allow develoment of the html package to be less test-driven, while still having the advantages of regression tests. In other words, one can work on any portion of the parser and quickly see whether he is breaking things or improving them. Current statistics of the tests: $ grep ^PASS *.log|wc -l 1017 $ grep ^PARSE *.log|wc -l 46 $ grep ^FAIL *.log|wc -l 181

Patch Set 1 #

Patch Set 2 : diff -r 0324cadd9b98 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 0324cadd9b98 https://go.googlecode.com/hg/ #

Total comments: 10

Patch Set 4 : diff -r 0324cadd9b98 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 0324cadd9b98 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1407 lines, -64 lines) Patch
M src/pkg/exp/html/parse_test.go View 1 2 3 4 3 chunks +163 lines, -64 lines 0 comments Download
A src/pkg/exp/html/testlogs/adoption01.dat.log View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/adoption02.dat.log View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/comments01.dat.log View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/doctype01.dat.log View 1 2 3 1 chunk +37 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/entities01.dat.log View 1 2 3 1 chunk +67 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/entities02.dat.log View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/html5test-com.dat.log View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/inbody01.dat.log View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/isindex.dat.log View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/pending-spec-changes-plain-text-unsafe.dat.log View 1 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/pending-spec-changes.dat.log View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/plain-text-unsafe.dat.log View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/scriptdata01.dat.log View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tables01.dat.log View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests1.dat.log View 1 2 3 1 chunk +114 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests10.dat.log View 1 2 3 1 chunk +54 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests11.dat.log View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests12.dat.log View 1 1 chunk +2 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests14.dat.log View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests15.dat.log View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests16.dat.log View 1 2 3 1 chunk +189 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests17.dat.log View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests18.dat.log View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests19.dat.log View 1 2 3 1 chunk +103 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests2.dat.log View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests20.dat.log View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests21.dat.log View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests22.dat.log View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests23.dat.log View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests24.dat.log View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests25.dat.log View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests26.dat.log View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests3.dat.log View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests4.dat.log View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests5.dat.log View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests6.dat.log View 1 2 3 1 chunk +52 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests7.dat.log View 1 2 3 1 chunk +30 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests8.dat.log View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests9.dat.log View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tests_innerHTML_1.dat.log View 1 2 3 1 chunk +84 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/tricky01.dat.log View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/webkit01.dat.log View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
A src/pkg/exp/html/testlogs/webkit02.dat.log View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 7
andybalholm
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, nigeltao@golang.org), I'd like you to review this change to https://go.googlecode.com/hg/
14 years, 7 months ago (2012-04-14 17:20:27 UTC) #1
nigeltao
http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse.go File src/pkg/exp/html/parse.go (right): http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse.go#newcode1803 src/pkg/exp/html/parse.go:1803: defer func() { I don't think that this is ...
14 years, 7 months ago (2012-04-16 05:23:01 UTC) #2
nigeltao
http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse_test.go File src/pkg/exp/html/parse_test.go (right): http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse_test.go#newcode294 src/pkg/exp/html/parse_test.go:294: if expectedResult == "parse" { On 2012/04/16 05:23:01, nigeltao ...
14 years, 7 months ago (2012-04-16 05:25:17 UTC) #3
andybalholm
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 7 months ago (2012-04-16 16:44:39 UTC) #4
andybalholm
PTAL. http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse.go File src/pkg/exp/html/parse.go (right): http://codereview.appspot.com/6031049/diff/1047/src/pkg/exp/html/parse.go#newcode1803 src/pkg/exp/html/parse.go:1803: defer func() { I extracted just enough of ...
14 years, 7 months ago (2012-04-16 16:46:20 UTC) #5
nigeltao
LGTM. Thanks for doing this.
14 years, 7 months ago (2012-04-17 07:14:17 UTC) #6
nigeltao
14 years, 7 months ago (2012-04-17 07:17:30 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=316890203045 ***

exp/html: more comprehensive tests

Currently, the html package only runs a limited subset of the tests
in the testdata directory. This tends to limit development of the
parser to fixing the bug that causes the first failing test.

This CL gives it the ability to run all the tests and produce a
log showing the status of each test. (It does it when tests are run with
'go test --update-logs') The status is listed as PASS, FAIL, or PARSE
(PARSE means that parsing produced the correct tree, but rendering and
re-parsing does not produce the same tree).

When 'go test' is run without --update-logs, it runs the tests marked
'PASS' in the logs (and the parsing portion of the tests marked 'PARSE').
Thus it will fail if there has been a regression since the last
time the logs were updated.

My goal for this CL is to allow develoment of the html package to
be less test-driven, while still having the advantages of regression
tests. In other words, one can work on any portion of the parser
and quickly see whether he is breaking things or improving them.

Current statistics of the tests:
$ grep ^PASS *.log|wc -l
        1017
$ grep ^PARSE *.log|wc -l
          46
$ grep ^FAIL *.log|wc -l
         181

R=nigeltao
CC=golang-dev
http://codereview.appspot.com/6031049

Committer: Nigel Tao <nigeltao@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b