mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
test: reword misspelled fixtures that trip codespell (#13290)
This commit is contained in:
1 parent
9f9c28471f
commit
081218bf8a
3 files changed
+7
-7
No files matched your search
@@ -127,7 +127,7 @@ func TestParseConfigurationRejects(t *testing.T) {
|
||||
{"misspelled filter", queueDoc(`<Queue>arn:aws:sqs:::t</Queue><Event>s3:ObjectCreated:*</Event><Filtr><S3Key>` + filterRule("prefix", "a") + `</S3Key></Filtr>`), s3err.ErrMalformedXML},
|
||||
{"misspelled s3key", queueDoc(`<Queue>arn:aws:sqs:::t</Queue><Event>s3:ObjectCreated:*</Event><Filter><S3Ky>` + filterRule("prefix", "a") + `</S3Ky></Filter>`), s3err.ErrMalformedXML},
|
||||
{"misspelled filter rule", filterDoc(`<FiltrRule><Name>prefix</Name><Value>a</Value></FiltrRule>`), s3err.ErrMalformedXML},
|
||||
{"misspelled value", filterDoc(`<FilterRule><Name>prefix</Name><Valu>private/</Valu></FilterRule>`), s3err.ErrMalformedXML},
|
||||
{"misspelled value", filterDoc(`<FilterRule><Name>prefix</Name><Val>private/</Val></FilterRule>`), s3err.ErrMalformedXML},
|
||||
{"topic in a queue rule", queueDoc(`<Queue>arn:aws:sqs:::t</Queue><Topic>arn:aws:sns:::u</Topic><Event>s3:ObjectCreated:*</Event>`), s3err.ErrMalformedXML},
|
||||
{"no destination", queueDoc(`<Event>s3:ObjectCreated:*</Event>`), s3err.ErrMalformedXML},
|
||||
{"no event", queueDoc(`<Queue>arn:aws:sqs:::t</Queue>`), s3err.ErrMalformedXML},
|
||||
|
||||
@@ -83,7 +83,7 @@ func TestParseTargetsRejects(t *testing.T) {
|
||||
"name with colon": `{"targets":[{"name":"a:b","type":"topic"}]}`,
|
||||
"name with slash": `{"targets":[{"name":"a/b","type":"topic"}]}`,
|
||||
"name too long": `{"targets":[{"name":"` + strings.Repeat("a", 65) + `","type":"topic"}]}`,
|
||||
"unknown field": `{"targets":[{"name":"a","type":"topic","endpont":"x"}]}`,
|
||||
"unknown field": `{"targets":[{"name":"a","type":"topic","endpoints":"x"}]}`,
|
||||
"unknown top field": `{"target":[]}`,
|
||||
"null target": `{"targets":[null]}`,
|
||||
"webhook no endpoint": `{"targets":[{"name":"a","type":"webhook"}]}`,
|
||||
|
||||
@@ -173,15 +173,15 @@ func TestWriteRecordsContentMd5(t *testing.T) {
|
||||
}
|
||||
|
||||
f := newFile(true)
|
||||
write(f, 0, "hel")
|
||||
write(f, 3, "lo")
|
||||
if got, want := hex.EncodeToString(f.contentMd5()), hex.EncodeToString(util.Md5([]byte("hello"))); got != want {
|
||||
write(f, 0, "abc")
|
||||
write(f, 3, "def")
|
||||
if got, want := hex.EncodeToString(f.contentMd5()), hex.EncodeToString(util.Md5([]byte("abcdef"))); got != want {
|
||||
t.Errorf("in-order write MD5 = %q", got)
|
||||
}
|
||||
|
||||
f = newFile(true)
|
||||
write(f, 3, "lo")
|
||||
write(f, 0, "hel")
|
||||
write(f, 3, "def")
|
||||
write(f, 0, "abc")
|
||||
if f.contentMd5() != nil {
|
||||
t.Error("out-of-order write got an MD5")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user