File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ import (
77var Years = []int {2017 , 2003 , 2026 }
88var Pets = []string {"Dog" , "Cat" , "Parrot" }
99
10- func SortNumbers () []int {
10+ func SortYears () []int {
1111 slices .Sort (Years )
1212 return Years
1313}
1414
15- func SortAnimals () []string {
15+ func SortPets () []string {
1616 slices .Sort (Pets )
1717 return Pets
1818}
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ package sorting
33var Years = []int {2017 , 2003 , 2026 }
44var Pets = []string {"Dog" , "Cat" , "Parrot" }
55
6- func SortNumbers () []int {
6+ func SortYears () []int {
77 return Years
88}
99
10- func SortAnimals () []string {
10+ func SortPets () []string {
1111 return Pets
1212}
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ import (
77
88func TestSorting (t * testing.T ) {
99 t .Run ("Sorting numbers" , func (t * testing.T ) {
10- SortNumbers ()
10+ SortYears ()
1111 if ! slices .IsSorted (Years ) {
1212 t .Fatal ("Strings are not sorted!" )
1313 }
1414 })
1515
1616 t .Run ("Sorting strings" , func (t * testing.T ) {
17- SortAnimals ()
17+ SortPets ()
1818 if ! slices .IsSorted (Pets ) {
1919 t .Fatal ("Strings are not sorted!" )
2020 }
You can’t perform that action at this time.
0 commit comments