@@ -103,7 +103,7 @@ func TestGoldenFile(t *testing.T, fileName string, actual []byte, replacements m
103
103
actual = bytes .ReplaceAll (actual , []byte (k ), []byte (v ))
104
104
}
105
105
106
- actual = NormalizeGoldenFile (t , actual )
106
+ actual = normalizeGoldenFile (t , actual )
107
107
goldenPath := filepath .Join ("testdata" , strings .ReplaceAll (fileName , " " , "_" )+ ".golden" )
108
108
if * UpdateGoldenFiles {
109
109
t .Logf ("update golden file for: %q: %s" , fileName , goldenPath )
@@ -114,18 +114,18 @@ func TestGoldenFile(t *testing.T, fileName string, actual []byte, replacements m
114
114
expected , err := os .ReadFile (goldenPath )
115
115
require .NoError (t , err , "read golden file, run \" make update-golden-files\" and commit the changes" )
116
116
117
- expected = NormalizeGoldenFile (t , expected )
117
+ expected = normalizeGoldenFile (t , expected )
118
118
require .Equal (
119
119
t , string (expected ), string (actual ),
120
120
"golden file mismatch: %s, run \" make update-golden-files\" , verify and commit the changes" ,
121
121
goldenPath ,
122
122
)
123
123
}
124
124
125
- // NormalizeGoldenFile replaces any strings that are system or timing dependent
125
+ // normalizeGoldenFile replaces any strings that are system or timing dependent
126
126
// with a placeholder so that the golden files can be compared with a simple
127
127
// equality check.
128
- func NormalizeGoldenFile (t * testing.T , byt []byte ) []byte {
128
+ func normalizeGoldenFile (t * testing.T , byt []byte ) []byte {
129
129
// Replace any timestamps with a placeholder.
130
130
byt = timestampRegex .ReplaceAll (byt , []byte ("[timestamp]" ))
131
131
0 commit comments