Skip to content

Commit

Permalink
internal/phpgrep: print num of matches (#62)
Browse files Browse the repository at this point in the history
Fixes #61

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
  • Loading branch information
quasilyte authored Oct 28, 2020
1 parent 21db035 commit 3b666ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/phpgrep/end2end_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -219,6 +220,7 @@ func TestEnd2End(t *testing.T) {
}
have := strings.Split(strings.TrimSpace(string(out)), "\n")
want := test.matches
want = append(want, fmt.Sprintf("found %d matches", len(test.matches)))
if diff := cmp.Diff(want, have); diff != "" {
t.Errorf("output mismatch (+have -want):\n%s", diff)
}
Expand Down
1 change: 1 addition & 0 deletions internal/phpgrep/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func (p *program) printMatches() error {
}
}
}
log.Printf("found %d matches", printed)
return nil
}

Expand Down

0 comments on commit 3b666ab

Please # to comment.