TestReplaceStringInFile tests the ReplaceStringInFile utility function.
(t *testing.T)
| 171 | |
| 172 | // TestReplaceStringInFile tests the ReplaceStringInFile utility function. |
| 173 | func TestReplaceStringInFile(t *testing.T) { |
| 174 | assert := asrt.New(t) |
| 175 | tmpDir := testcommon.CreateTmpDir(t.Name()) |
| 176 | newFilePath := filepath.Join(tmpDir, "newfile.txt") |
| 177 | err := fileutil.ReplaceStringInFile("some needle we're looking for", "specialJUNKPattern", "testdata/fgrep_has_positive_contents.txt", newFilePath) |
| 178 | assert.NoError(err) |
| 179 | found, err := fileutil.FgrepStringInFile(newFilePath, "specialJUNKPattern") |
| 180 | assert.NoError(err) |
| 181 | assert.True(found) |
| 182 | } |
| 183 | |
| 184 | // TestFindSimulatedXsymSymlinks tests FindSimulatedXsymSymlinks |
| 185 | func TestFindSimulatedXsymSymlinks(t *testing.T) { |
nothing calls this directly
no test coverage detected