@@ -184,18 +184,23 @@ another`
184184 assert .Equal (t , diff , r .Diff )
185185}
186186
187- func TestFileMatcher_Validate (t * testing.T ) {
187+ func TestFileMatcher_Match (t * testing.T ) {
188+ ReadFile = func (filename string ) ([]byte , error ) {
189+ return []byte ("line one\n line two" ), nil
190+ }
188191 m := FileMatcher {}
189- got := m .Match ("zoom " , "zoom .txt" )
192+ got := m .Match ("line one \n line two " , "fake .txt" )
190193 assert .True (t , got .Success )
191194 assert .Equal (t , "" , got .Diff )
192195}
193196
194197func TestFileMatcher_ValidateFails (t * testing.T ) {
198+ ReadFile = func (filename string ) ([]byte , error ) {
199+ return []byte ("line one\n line two" ), nil
200+ }
195201 m := FileMatcher {}
196- got := m .Match ("zoom " , "zoologist .txt" )
202+ got := m .Match ("line one \n line three " , "fake .txt" )
197203 assert .False (t , got .Success )
198- println (got .Diff )
199- assert .Contains (t , got .Diff , "+zoologist" )
200- assert .Contains (t , got .Diff , "-zoom" )
204+ assert .Contains (t , got .Diff , "+line two" )
205+ assert .Contains (t , got .Diff , "-line three" )
201206}
0 commit comments