(t *testing.T)
| 1167 | } |
| 1168 | |
| 1169 | func TestSHA256Sums_OutputsCorrectHashForEachSpecifiedFile(t *testing.T) { |
| 1170 | t.Parallel() |
| 1171 | tcs := []struct { |
| 1172 | testFileName string |
| 1173 | want string |
| 1174 | }{ |
| 1175 | // To get the checksum run: openssl dgst -sha256 <file_name> |
| 1176 | {"testdata/hashSum.input.txt", "1870478d23b0b4db37735d917f4f0ff9393dd3e52d8b0efa852ab85536ddad8e\n"}, |
| 1177 | {"testdata/hello.txt", "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9\n"}, |
| 1178 | {"testdata/multiple_files", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\ne3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n"}, |
| 1179 | } |
| 1180 | for _, tc := range tcs { |
| 1181 | got, err := script.ListFiles(tc.testFileName).SHA256Sums().String() |
| 1182 | if err != nil { |
| 1183 | t.Fatal(err) |
| 1184 | } |
| 1185 | if got != tc.want { |
| 1186 | t.Errorf("%q: want %q, got %q", tc.testFileName, tc.want, got) |
| 1187 | } |
| 1188 | } |
| 1189 | } |
| 1190 | |
| 1191 | func TestTeeUsesConfiguredStdoutAsDefault(t *testing.T) { |
| 1192 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…