Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: exercism/go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 830c586fa6016c106358566961647a90469af899
Choose a base ref
..
head repository: exercism/go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 36039cb6cee1d6af03ab3aaeb7fef003726dfdf7
Choose a head ref
Showing with 7 additions and 7 deletions.
  1. +7 −7 exercises/concept/bird-watcher/bird_watcher_test.go
14 changes: 7 additions & 7 deletions exercises/concept/bird-watcher/bird_watcher_test.go
Original file line number Diff line number Diff line change
@@ -78,6 +78,11 @@ func TestFixBirdCount(t *testing.T) {
week int
want []int
}{
{
name: "returns a bird count list with the corrected values",
birdCounts: []int{3, 0, 5, 1, 0, 4, 1, 0, 3, 4, 3, 0},
want: []int{4, 0, 6, 1, 1, 4, 2, 0, 4, 4, 4, 0},
},
{
name: "works for a short bird count list",
birdCounts: []int{4, 2},
@@ -87,12 +92,7 @@ func TestFixBirdCount(t *testing.T) {
name: "works for a long bird count list",
birdCounts: []int{2, 8, 4, 1, 3, 5, 0, 4, 1, 6, 0, 3, 0, 1, 5, 4, 1, 1, 2, 6},
want: []int{3, 8, 5, 1, 4, 5, 1, 4, 2, 6, 1, 3, 1, 1, 6, 4, 2, 1, 3, 6},
},
{
name: "does not create new slice",
birdCounts: []int{3, 0, 5, 1, 0, 4, 1, 0, 3, 4, 3, 0},
want: []int{4, 0, 6, 1, 1, 4, 2, 0, 4, 4, 4, 0},
},
}
}

// Test normal cases - last test needs to be tested differently
@@ -106,7 +106,7 @@ func TestFixBirdCount(t *testing.T) {

// Test special case
t.Run("does not create new slice", func(t *testing.T) {
counts := []int{3, 0, 5, 1, 0, 4, 1, 0, 3, 4, 3, 0}
counts := []int{4, 0, 6, 1, 1, 4, 2, 0, 4, 4, 4, 0}
got := FixBirdCountLog(counts)
if reflect.ValueOf(got).Pointer() != reflect.ValueOf(counts).Pointer() {
t.Error("it looks like that you are creating a new slice in the function FixBirdCountLog - " +