move to 2.5.5
[anni] / test / pleroma / otp_version_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.OTPVersionTest do
6   use ExUnit.Case, async: true
7
8   alias Pleroma.OTPVersion
9
10   describe "check/1" do
11     test "22.4" do
12       assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/22.4"]) ==
13                "22.4"
14     end
15
16     test "22.1" do
17       assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/22.1"]) ==
18                "22.1"
19     end
20
21     test "21.1" do
22       assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/21.1"]) ==
23                "21.1"
24     end
25
26     test "23.0" do
27       assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/23.0"]) ==
28                "23.0"
29     end
30
31     test "with non existance file" do
32       assert OTPVersion.get_version_from_files([
33                "test/fixtures/warnings/otp_version/non-exising",
34                "test/fixtures/warnings/otp_version/22.4"
35              ]) == "22.4"
36     end
37
38     test "empty paths" do
39       assert OTPVersion.get_version_from_files([]) == nil
40     end
41   end
42 end