-- readFileContent --.
(t *testing.T)
| 1183 | // -- readFileContent --. |
| 1184 | |
| 1185 | func TestReadFileContent_SizeLimit(t *testing.T) { |
| 1186 | t.Parallel() |
| 1187 | |
| 1188 | dir := t.TempDir() |
| 1189 | // Write a file slightly over maxDetectionFileSize (10 MB). |
| 1190 | oversizedFile := filepath.Join(dir, "big.xml") |
| 1191 | data := make([]byte, maxDetectionFileSize+1) |
| 1192 | require.NoError(t, os.WriteFile(oversizedFile, data, 0600)) |
| 1193 | |
| 1194 | content, ok := readFileContent(dir, "big.xml") |
| 1195 | assert.False(t, ok, "readFileContent should reject files over maxDetectionFileSize") |
| 1196 | assert.Empty(t, content) |
| 1197 | } |
| 1198 | |
| 1199 | // -- defaultPortForFramework --. |
| 1200 |
nothing calls this directly
no test coverage detected