Skip to content

Commit

Permalink
chore: slice replace loop (#2278)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Jul 25, 2023
1 parent 55791d6 commit 06264a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions cmd/zt_scenario_helpers_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ func (scenarioHelper) generateCommonRemoteScenarioForWASB(a *assert.Assertions,
createNewDirectoryStub(a, containerURL, prefix+"sub1/sub3/sub5")
createNewDirectoryStub(a, containerURL, prefix+"sub2")

for _, dirPath := range []string{prefix + "sub1", prefix + "sub1/sub3", prefix + "sub1/sub3/sub5", prefix + "sub2"} {
blobList = append(blobList, dirPath)
}

blobList = append(blobList, []string{prefix + "sub1", prefix + "sub1/sub3", prefix + "sub1/sub3/sub5", prefix + "sub2"}...)
// sleep a bit so that the blobs' lmts are guaranteed to be in the past
time.Sleep(time.Millisecond * 1050)
return
Expand Down
10 changes: 3 additions & 7 deletions common/extensions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,11 @@ func TestRedaction(t *testing.T) {
for input, expectedOutput := range redactionTests {
queryKeyNeedRedact := "sig"
expectedOutputParams := make([]string, 0)
for _, param := range strings.Split(expectedOutput, "&") {
expectedOutputParams = append(expectedOutputParams, param)
}
expectedOutputParams = append(expectedOutputParams, strings.Split(expectedOutput, "&")...)

isRedacted, actualOutput := RedactSecretQueryParam(input, queryKeyNeedRedact)
actualOutputParams := make([]string, 0)
for _, param := range strings.Split(actualOutput, "&") {
actualOutputParams = append(actualOutputParams, param)
}
actualOutputParams = append(actualOutputParams, strings.Split(actualOutput, "&")...)

a.Equal(len(actualOutputParams), len(expectedOutputParams))

Expand Down Expand Up @@ -171,4 +167,4 @@ func TestBlockblobBlockIDGeneration(t *testing.T) {
a.Equal(blockName, tmp)
}

}
}

0 comments on commit 06264a1

Please sign in to comment.