elixir/elixir-1.6.5-disable_tests_on_erlang_sources_if_unavailable.patch
2018-06-07 11:09:26 +02:00

66 lines
2.4 KiB
Diff

--- lib/iex/test/iex/helpers_test.exs.orig 2018-05-07 12:36:01.000000000 +0200
+++ lib/iex/test/iex/helpers_test.exs 2018-06-07 10:20:27.196176134 +0200
@@ -195,30 +195,38 @@
~r/#{@elixir_erl}:\d+$/
end
- 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/arity" do
- assert capture_iex("open(:lists.reverse/1)") |> maybe_trim_quotes() =~
- ~r/#{@lists_erl}:\d+$/
- end
-
- 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/arity" do
- assert capture_iex("open(:httpc.request/1)") |> maybe_trim_quotes() =~
- ~r/#{@httpc_erl}:\d+$/
+ # 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/arity" do
+ assert capture_iex("open(:lists.reverse/1)") |> maybe_trim_quotes() =~
+ ~r/#{@lists_erl}:\d+$/
+ end
+ 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/arity" do
+ assert capture_iex("open(:httpc.request/1)") |> maybe_trim_quotes() =~
+ ~r/#{@httpc_erl}:\d+$/
+ end
end
test "errors OTP preloaded module" do