Skip to content

Commit

Permalink
Add test for warning output
Browse files Browse the repository at this point in the history
  • Loading branch information
axelson committed Sep 20, 2024
1 parent 804c271 commit baaa24d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/mix/tasks/dialyzer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,12 @@ defmodule Mix.Tasks.DialyzerTest do
assert result =~
~r/Total errors: ., Skipped: ., Unnecessary Skips: .\ndone \(passed successfully\)\n/
end

@tag :output_tests
test "Warning is printed when unknown format is requested" do
args = ["dialyzer", "--format", "foo"]
env = [{"MIX_ENV", "prod"}]
{result, 0} = System.cmd("mix", args, env: env)
assert result =~ "Unrecognized formatter foo received. Known formatters are dialyzer, dialyxir, github, ignore_file, ignore_file_string, raw, and short. Falling back to dialyxir."
end
end

0 comments on commit baaa24d

Please sign in to comment.