Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85648821
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
970 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/test/install_version_test.exs b/test/install_version_test.exs
new file mode 100644
index 0000000..d135013
--- /dev/null
+++ b/test/install_version_test.exs
@@ -0,0 +1,27 @@
+defmodule InstallVersionTest do
+ use ExUnit.Case, async: true
+
+ describe("install version check") do
+ test "README.md" do
+ assert_version("README.md")
+ end
+ end
+
+ defp assert_version(filename) do
+ app = Keyword.get(Mix.Project.config(), :app)
+ app_version = app |> Application.spec(:vsn) |> to_string()
+
+ file = File.read!(filename)
+ [_, file_versions] = Regex.run(~r/{:#{app}, "(.+)"}/, file)
+
+ assert Version.match?(
+ app_version,
+ file_versions
+ ),
+ """
+ Install version constraint in `#{filename}` does not match to current app version.
+ Current App Version: #{app_version}
+ `#{filename}` Install Versions: #{file_versions}
+ """
+ end
+end
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Aug 28, 9:01 PM (20 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1736002
Default Alt Text
(970 B)
Attached To
Mode
R17 flake_id
Attached
Detach File
Event Timeline
Log In to Comment