logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma

otp_version_test.exs (1205B)


  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. defmodule Pleroma.OTPVersionTest do
  5. use ExUnit.Case, async: true
  6. alias Pleroma.OTPVersion
  7. describe "check/1" do
  8. test "22.4" do
  9. assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/22.4"]) ==
  10. "22.4"
  11. end
  12. test "22.1" do
  13. assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/22.1"]) ==
  14. "22.1"
  15. end
  16. test "21.1" do
  17. assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/21.1"]) ==
  18. "21.1"
  19. end
  20. test "23.0" do
  21. assert OTPVersion.get_version_from_files(["test/fixtures/warnings/otp_version/23.0"]) ==
  22. "23.0"
  23. end
  24. test "with non existance file" do
  25. assert OTPVersion.get_version_from_files([
  26. "test/fixtures/warnings/otp_version/non-exising",
  27. "test/fixtures/warnings/otp_version/22.4"
  28. ]) == "22.4"
  29. end
  30. test "empty paths" do
  31. assert OTPVersion.get_version_from_files([]) == nil
  32. end
  33. end
  34. end