@@ -137,16 +137,9 @@ func TestRepoFork_in_parent_yes(t *testing.T) {
137137
138138 eq (t , output .Stderr (), "" )
139139
140- expectedLines := []* regexp.Regexp {
141- regexp .MustCompile (`Created fork someone/REPO` ),
142- regexp .MustCompile (`Remote added at fork` ),
143- }
144- for _ , r := range expectedLines {
145- if ! r .MatchString (output .String ()) {
146- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
147- return
148- }
149- }
140+ test .ExpectLines (t , output .String (),
141+ "Created fork someone/REPO" ,
142+ "Remote added at fork" )
150143}
151144
152145func TestRepoFork_outside_yes (t * testing.T ) {
@@ -169,16 +162,9 @@ func TestRepoFork_outside_yes(t *testing.T) {
169162
170163 eq (t , strings .Join (seenCmd .Args , " " ), "git clone https://github.com/someone/repo.git" )
171164
172- expectedLines := []* regexp.Regexp {
173- regexp .MustCompile (`Created fork someone/REPO` ),
174- regexp .MustCompile (`Cloned fork` ),
175- }
176- for _ , r := range expectedLines {
177- if ! r .MatchString (output .String ()) {
178- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
179- return
180- }
181- }
165+ test .ExpectLines (t , output .String (),
166+ "Created fork someone/REPO" ,
167+ "Cloned fork" )
182168}
183169
184170func TestRepoFork_outside_survey_yes (t * testing.T ) {
@@ -208,16 +194,9 @@ func TestRepoFork_outside_survey_yes(t *testing.T) {
208194
209195 eq (t , strings .Join (seenCmd .Args , " " ), "git clone https://github.com/someone/repo.git" )
210196
211- expectedLines := []* regexp.Regexp {
212- regexp .MustCompile (`Created fork someone/REPO` ),
213- regexp .MustCompile (`Cloned fork` ),
214- }
215- for _ , r := range expectedLines {
216- if ! r .MatchString (output .String ()) {
217- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
218- return
219- }
220- }
197+ test .ExpectLines (t , output .String (),
198+ "Created fork someone/REPO" ,
199+ "Cloned fork" )
221200}
222201
223202func TestRepoFork_outside_survey_no (t * testing.T ) {
@@ -290,16 +269,9 @@ func TestRepoFork_in_parent_survey_yes(t *testing.T) {
290269
291270 eq (t , output .Stderr (), "" )
292271
293- expectedLines := []* regexp.Regexp {
294- regexp .MustCompile (`Created fork someone/REPO` ),
295- regexp .MustCompile (`Remote added at fork` ),
296- }
297- for _ , r := range expectedLines {
298- if ! r .MatchString (output .String ()) {
299- t .Errorf ("output did not match regexp /%s/\n > output\n %s\n " , r , output )
300- return
301- }
302- }
272+ test .ExpectLines (t , output .String (),
273+ "Created fork someone/REPO" ,
274+ "Remote added at fork" )
303275}
304276
305277func TestRepoFork_in_parent_survey_no (t * testing.T ) {
0 commit comments