chore: cleaned up bang-Operator usage

This commit is contained in:
2026-05-01 16:56:21 +02:00
parent 7f5077c6ad
commit a95e9482a7
13 changed files with 459 additions and 266 deletions

View File

@@ -910,6 +910,20 @@ defmodule BDS.GenerationTest do
assert clean_report.updated_post_url_paths == []
end
test "apply_validation returns an error for unreadable generated files", %{
project: project,
temp_dir: temp_dir
} do
unreadable_path = Path.join([temp_dir, "html", "obsolete", "index.html"])
File.mkdir_p!(Path.dirname(unreadable_path))
File.write!(unreadable_path, "<html>obsolete</html>")
File.chmod!(unreadable_path, 0o000)
on_exit(fn -> File.chmod!(unreadable_path, 0o644) end)
assert {:error, {:read_generated_file, ^unreadable_path, :eacces}} =
BDS.Generation.apply_validation(project.id, [:core])
end
test "validate_site regenerates sitemap and reports missing, extra, and updated post url paths",
%{project: project, temp_dir: temp_dir} do
assert {:ok, _metadata} =