From 622fad97214897d835e1a8c3f3313024046ea1e1 Mon Sep 17 00:00:00 2001 From: Philip Ross Date: Tue, 22 Dec 2020 18:21:49 -0800 Subject: [PATCH] added tests for setting a local plt path --- test/dialyxir/project_test.exs | 8 +++++++- test/fixtures/alt_local_path/mix.exs | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/alt_local_path/mix.exs diff --git a/test/dialyxir/project_test.exs b/test/dialyxir/project_test.exs index 7d3d5cc9..03171b57 100644 --- a/test/dialyxir/project_test.exs +++ b/test/dialyxir/project_test.exs @@ -16,7 +16,13 @@ defmodule Dialyxir.ProjectTest do test "Default Project PLT File in _build dir" do in_project(:default_apps, fn -> - assert Regex.match?(~r/_build.*plt/, Project.plt_file()) + assert Regex.match?(~r/_build\/.*plt/, Project.plt_file()) + end) + end + + test "Can specify a different local PLT path" do + in_project(:alt_local_path, fn -> + assert Regex.match?(~r/dialyzer\/.*plt/, Project.plt_file()) end) end diff --git a/test/fixtures/alt_local_path/mix.exs b/test/fixtures/alt_local_path/mix.exs new file mode 100644 index 00000000..ec8fdd42 --- /dev/null +++ b/test/fixtures/alt_local_path/mix.exs @@ -0,0 +1,7 @@ +defmodule AltLocalPath.Mixfile do + use Mix.Project + + def project do + [app: :alt_local_path, version: "1.0.0", dialyzer: [plt_local_path: "dialyzer"]] + end +end