diff options
author | John Eckersberg <jeckersb@redhat.com> | 2018-05-25 18:05:56 -0400 |
---|---|---|
committer | Andrea Leopardi <an.leopardi@gmail.com> | 2018-05-26 00:05:56 +0200 |
commit | 51d61cbdfb6d6ef2589ccf94c42ad8840ffeb8ed (patch) | |
tree | 4d613a8e85e366bbfdec784136923898236dfbbe | |
parent | 4d3084b3fbc28b6b2522397bc2474b81e0abb4d7 (diff) | |
download | elixir-51d61cbdfb6d6ef2589ccf94c42ad8840ffeb8ed.tar.gz |
Only test the open/1 IEx helper on Erlang source if it exists (#7350) (#7711)
-rw-r--r-- | lib/iex/test/iex/helpers_test.exs | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/lib/iex/test/iex/helpers_test.exs b/lib/iex/test/iex/helpers_test.exs index ff6d014bb..85d579f0f 100644 --- a/lib/iex/test/iex/helpers_test.exs +++ b/lib/iex/test/iex/helpers_test.exs @@ -195,30 +195,38 @@ defmodule IEx.HelpersTest do ~r/#{@elixir_erl}:\d+$/ end - test "opens OTP lists module" do - assert capture_iex("open(:lists)") |> maybe_trim_quotes() =~ ~r/#{@lists_erl}:\d+$/ - end + # Some installations remove the source file once Erlang is compiled. See #7348. + if File.regular?(@lists_erl) do + test "opens OTP lists module" do + assert capture_iex("open(:lists)") |> maybe_trim_quotes() =~ ~r/#{@lists_erl}:\d+$/ + end - test "opens OTP lists module.function" do - assert capture_iex("open(:lists.reverse)") |> maybe_trim_quotes() =~ ~r/#{@lists_erl}:\d+$/ - end + test "opens OTP lists module.function" do + assert capture_iex("open(:lists.reverse)") |> maybe_trim_quotes() =~ + ~r/#{@lists_erl}:\d+$/ + end - test "opens OTP lists module.function/arity" do - assert capture_iex("open(:lists.reverse/1)") |> maybe_trim_quotes() =~ - ~r/#{@lists_erl}:\d+$/ + test "opens OTP lists module.function/arity" do + assert capture_iex("open(:lists.reverse/1)") |> maybe_trim_quotes() =~ + ~r/#{@lists_erl}:\d+$/ + end end - test "opens OTP httpc module" do - assert capture_iex("open(:httpc)") |> maybe_trim_quotes() =~ ~r/#{@httpc_erl}:\d+$/ - end + # Some installations remove the source file once Erlang is compiled. See #7348. + if File.regular?(@httpc_erl) do + test "opens OTP httpc module" do + assert capture_iex("open(:httpc)") |> maybe_trim_quotes() =~ ~r/#{@httpc_erl}:\d+$/ + end - test "opens OTP httpc module.function" do - assert capture_iex("open(:httpc.request)") |> maybe_trim_quotes() =~ ~r/#{@httpc_erl}:\d+$/ - end + test "opens OTP httpc module.function" do + assert capture_iex("open(:httpc.request)") |> maybe_trim_quotes() =~ + ~r/#{@httpc_erl}:\d+$/ + end - test "opens OTP httpc module.function/arity" do - assert capture_iex("open(:httpc.request/1)") |> maybe_trim_quotes() =~ - ~r/#{@httpc_erl}:\d+$/ + test "opens OTP httpc module.function/arity" do + assert capture_iex("open(:httpc.request/1)") |> maybe_trim_quotes() =~ + ~r/#{@httpc_erl}:\d+$/ + end end test "errors OTP preloaded module" do |