Merge branch 'develop' into gun
[akkoma] / test / otp_version_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 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.check(["test/fixtures/warnings/otp_version/22.4"]) == :ok
13 end
14
15 test "22.1" do
16 assert OTPVersion.check(["test/fixtures/warnings/otp_version/22.1"]) == {:error, "22.1"}
17 end
18
19 test "21.1" do
20 assert OTPVersion.check(["test/fixtures/warnings/otp_version/21.1"]) == {:error, "21.1"}
21 end
22
23 test "23.0" do
24 assert OTPVersion.check(["test/fixtures/warnings/otp_version/23.0"]) == :ok
25 end
26
27 test "with non existance file" do
28 assert OTPVersion.check([
29 "test/fixtures/warnings/otp_version/non-exising",
30 "test/fixtures/warnings/otp_version/22.4"
31 ]) == :ok
32 end
33
34 test "empty paths" do
35 assert OTPVersion.check([]) == :undefined
36 end
37 end
38 end