golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.2k stars 17.57k forks source link

encoding/xml: more tests #6094

Open rsc opened 11 years ago

rsc commented 11 years ago
encoding/xml is under-tested. Now that we have go tool cover, it might be nice to write
some more tests, especially of things like name spaces, custom marshalers, custom
unmarshalers, and the interaction between all those.
rsc commented 11 years ago

Comment 1:

Labels changed: added testing.

rsc commented 11 years ago

Comment 2:

Labels changed: added go1.3, removed go1.2maybe.

rsc commented 10 years ago

Comment 3:

Labels changed: added release-go1.3.

rsc commented 10 years ago

Comment 4:

Labels changed: removed go1.3.

rsc commented 10 years ago

Comment 5:

Labels changed: added repo-main.

shawnps commented 10 years ago

Comment 6:

Updated by https://golang.org/cl/47870043
rsc commented 10 years ago

Comment 7:

Labels changed: removed release-go1.3.

rsc commented 10 years ago

Comment 8:

Labels changed: added release-none.

gopherbot commented 10 years ago

Comment 9:

CL https://golang.org/cl/92230043 mentions this issue.
odeke-em commented 8 years ago

I think this issue can now be closed, we are at 86.2% coverage at commit 0ed70efc6b7ec096603c58f27c2668af3862bb3c

$ pwd
/Users/emmanuelodeke/go/src/go.googlesource.com/go/src/encoding/xml
$ go version
go version devel +0ed70ef Wed Feb 3 04:33:08 2016 +0000 darwin/amd64
$ go test -cover
PASS
coverage: 86.2% of statements
ok      encoding/xml    0.012s
Thomasdezeeuw commented 8 years ago

Shouldn't it be closed at 100%?

rsc commented 8 years ago

Coverage is not a good metric. Even 100% line coverage is not a guarantee of actual coverage. The initial report mentioned trying to test interactions between the different features. Line coverage only guarantees they are tested in isolation.

Thomasdezeeuw commented 8 years ago

I agree that 100% coverage isn't a guarantee for much, but I would see it as a minimum.

odeke-em commented 8 years ago

Gotcha, sounds like a plan. I'll try taking a stab at this for Go1.7.

gopherbot commented 3 years ago

Change https://golang.org/cl/263317 mentions this issue: encoding/xml: increase test coverage

gopherbot commented 1 month ago

Change https://go.dev/cl/606495 mentions this issue: encoding: add full support for marshalers with pointer receivers