Skip to content

Commit

Permalink
replace _all_ of the with %q
Browse files Browse the repository at this point in the history
  • Loading branch information
quii committed Jul 11, 2019
1 parent 3e326d1 commit ee184c8
Show file tree
Hide file tree
Showing 99 changed files with 195 additions and 195 deletions.
6 changes: 3 additions & 3 deletions command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func TestCLI(t *testing.T) {
want := "Chris"

if got != want {
t.Errorf("didn't record correct winner, got '%s', want '%s'", got, want)
t.Errorf("didn't record correct winner, got %q, want %q", got, want)
}
}
```
Expand Down Expand Up @@ -269,7 +269,7 @@ func assertPlayerWin(t *testing.T, store *StubPlayerStore, winner string) {
}

if store.winCalls[0] != winner {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], winner)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], winner)
}
}
```
Expand Down Expand Up @@ -480,7 +480,7 @@ func AssertPlayerWin(t *testing.T, store *StubPlayerStore, winner string) {
}

if store.winCalls[0] != winner {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], winner)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], winner)
}
}

Expand Down
6 changes: 3 additions & 3 deletions command-line/v1/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store the correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store the correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion command-line/v1/tape_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func TestTape_Write(t *testing.T) {
want := "abc"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
6 changes: 3 additions & 3 deletions command-line/v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store the correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store the correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion command-line/v2/tape_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func TestTape_Write(t *testing.T) {
want := "abc"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
4 changes: 2 additions & 2 deletions command-line/v3/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -147,6 +147,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion command-line/v3/tape_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ func TestTape_Write(t *testing.T) {
want := "abc"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion command-line/v3/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ func AssertPlayerWin(t *testing.T, store *StubPlayerStore, winner string) {
}

if store.WinCalls[0] != winner {
t.Errorf("did not store the correct winner got '%s' want '%s'", store.WinCalls[0], winner)
t.Errorf("did not store the correct winner got %q want %q", store.WinCalls[0], winner)
}
}
2 changes: 1 addition & 1 deletion dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestGreet(t *testing.T) {
want := "Hello, Chris"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion di/v1/di_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func TestGreet(t *testing.T) {
want := "Hello, Chris"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion di/v2/di_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func TestGreet(t *testing.T) {
want := "Hello, Chris"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion for/v1/repeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ func TestRepeat(t *testing.T) {
expected := "aaaaa"

if repeated != expected {
t.Errorf("expected '%s' but got '%s'", expected, repeated)
t.Errorf("expected %q but got %q", expected, repeated)
}
}
2 changes: 1 addition & 1 deletion for/v2/repeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ func TestRepeat(t *testing.T) {
expected := "aaaaa"

if repeated != expected {
t.Errorf("expected '%s' but got '%s'", expected, repeated)
t.Errorf("expected %q but got %q", expected, repeated)
}
}
2 changes: 1 addition & 1 deletion for/vx/repeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func TestRepeat(t *testing.T) {
expected := "aaaaa"

if repeated != expected {
t.Errorf("expected '%s' but got '%s'", expected, repeated)
t.Errorf("expected %q but got %q", expected, repeated)
}
}

Expand Down
10 changes: 5 additions & 5 deletions http-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestGETPlayers(t *testing.T) {
want := "20"

if got != want {
t.Errorf("got '%s', want '%s'", got, want)
t.Errorf("got %q, want %q", got, want)
}
})
}
Expand Down Expand Up @@ -204,7 +204,7 @@ t.Run("returns Floyd's score", func(t *testing.T) {
want := "10"

if got != want {
t.Errorf("got '%s', want '%s'", got, want)
t.Errorf("got %q, want %q", got, want)
}
})
```
Expand Down Expand Up @@ -306,7 +306,7 @@ func newGetScoreRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
```
Expand Down Expand Up @@ -605,7 +605,7 @@ func newGetScoreRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
```
Expand Down Expand Up @@ -855,7 +855,7 @@ t.Run("it records wins on POST", func(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
```
Expand Down
2 changes: 1 addition & 1 deletion http-server/v1/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestGETPlayers(t *testing.T) {
want := "20"

if got != want {
t.Errorf("got '%s', want '%s'", got, want)
t.Errorf("got %q, want %q", got, want)
}
})

Expand Down
2 changes: 1 addition & 1 deletion http-server/v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ func newGetScoreRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion http-server/v3/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ func newGetScoreRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
4 changes: 2 additions & 2 deletions http-server/v4/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand All @@ -103,6 +103,6 @@ func newGetScoreRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
4 changes: 2 additions & 2 deletions http-server/v5/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand All @@ -108,6 +108,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
2 changes: 1 addition & 1 deletion io.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ func TestTape_Write(t *testing.T) {
want := "abc"

if got != want {
t.Errorf("got '%s' want '%s'", got, want)
t.Errorf("got %q want %q", got, want)
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions io/v1/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
6 changes: 3 additions & 3 deletions io/v2/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
6 changes: 3 additions & 3 deletions io/v3/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
6 changes: 3 additions & 3 deletions io/v4/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestStoreWins(t *testing.T) {
}

if store.winCalls[0] != player {
t.Errorf("did not store correct winner got '%s' want '%s'", store.winCalls[0], player)
t.Errorf("did not store correct winner got %q want %q", store.winCalls[0], player)
}
})
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func getLeagueFromResponse(t *testing.T, body io.Reader) []Player {
league, err := NewLeague(body)

if err != nil {
t.Fatalf("Unable to parse response from server '%s' into slice of Player, '%v'", body, err)
t.Fatalf("Unable to parse response from server %q into slice of Player, '%v'", body, err)
}

return league
Expand Down Expand Up @@ -173,6 +173,6 @@ func newPostWinRequest(name string) *http.Request {
func assertResponseBody(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("response body is wrong, got '%s' want '%s'", got, want)
t.Errorf("response body is wrong, got %q want %q", got, want)
}
}
Loading

0 comments on commit ee184c8

Please sign in to comment.