mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
bytes, strings: allow -1 in Map to mean "drop this character".
xml: drop invalid characters in attribute names
when constructing struct field names.
R=rsc
CC=r
https://golang.org/cl/157104
This commit is contained in:
parent
67aa1399d6
commit
128974adfd
6 changed files with 91 additions and 26 deletions
|
|
@ -24,8 +24,8 @@ func TestUnmarshalFeed(t *testing.T) {
|
|||
// hget http://codereview.appspot.com/rss/mine/rsc
|
||||
const rssFeedString = `
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><link href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></link><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld</name></author><entry><title>rietveld: an attempt at pubsubhubbub
|
||||
</title><link href="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html">
|
||||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><li-nk href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></li-nk><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld</name></author><entry><title>rietveld: an attempt at pubsubhubbub
|
||||
</title><link hre-f="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html">
|
||||
An attempt at adding pubsubhubbub support to Rietveld.
|
||||
http://code.google.com/p/pubsubhubbub
|
||||
http://code.google.com/p/rietveld/issues/detail?id=155
|
||||
|
|
@ -208,3 +208,21 @@ not being used from outside intra_region_diff.py.
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
type FieldNameTest struct {
|
||||
in, out string;
|
||||
}
|
||||
|
||||
var FieldNameTests = []FieldNameTest{
|
||||
FieldNameTest{"Profile-Image", "profileimage"},
|
||||
FieldNameTest{"_score", "score"},
|
||||
}
|
||||
|
||||
func TestFieldName(t *testing.T) {
|
||||
for _, tt := range FieldNameTests {
|
||||
a := fieldName(tt.in);
|
||||
if a != tt.out {
|
||||
t.Fatalf("have %#v\nwant %#v\n\n", a, tt.out)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue