Compare commits

...
6 Commits
Author SHA1 Message Date
José Valim 139d2eac59 Release v1.1.1 2015-09-28 23:26:38 +02:00
José Valim 84b33461f3 Fix non integer checks in ranges 2015-09-28 23:23:35 +02:00
José Valim e88a1b6738 Ensure stacktraces are shown on app_path failures
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2015-09-28 22:50:06 +02:00
CrowdHailer 2e4c7abe4d removed obsolete type option from the GenEvent handler type
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2015-09-28 22:48:19 +02:00
Eric Entin a6723dcbc6 Fix assertion errors with more than 1 pinned var
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2015-09-26 18:24:21 +02:00
José Valim e878ddee4c Update docs directory 2015-09-25 11:00:20 +02:00
12 changed files with 71 additions and 11 deletions
+8
View File
@@ -46,6 +46,14 @@ Note: Erlang 17.1 contains a regression in its wildcard implementation that
causes tools like rebar to fail. If you have a project with rebar dependencies
and is using Erlang 17.1, remember to update to at least Erlang 17.3.
## v1.1.1 (2015-09-28)
### Bug fixes
* [Enum] Fix non-integer member checks with ranges
* [ExUnit] Fix assertion errors with more than 1 pinned var
* [Mix] Ensure umbrella apps can boot with build_embedded is true
## v1.1.0 (2015-09-25)
### 1. Enhancements
+1 -1
View File
@@ -1,6 +1,6 @@
REBAR ?= "$(CURDIR)/rebar"
PREFIX ?= /usr/local
DOCS := master
DOCS := v1.1
ELIXIRC := bin/elixirc --verbose --ignore-module-conflict
ERLC := erlc -I lib/elixir/include
ERL := erl -I lib/elixir/include -noshell -pa lib/elixir/ebin
+1 -1
View File
@@ -1 +1 @@
1.1.0
1.1.1
+1 -1
View File
@@ -602,7 +602,7 @@ defmodule Code do
"Converts an atom to a char list."
# Module doesn't exist
iex> docs = Code.get_docs(ModuleNotGood, :all)
iex> Code.get_docs(ModuleNotGood, :all)
nil
"""
+2
View File
@@ -1174,6 +1174,8 @@ defmodule Enum do
iex> Enum.member?(1..10, 5)
true
iex> Enum.member?(1..10, 5.0)
false
iex> Enum.member?([:a, :b, :c], :d)
false
+1 -1
View File
@@ -290,7 +290,7 @@ defmodule GenEvent do
@type manager :: pid | name | {atom, node}
@typedoc "Supported values for new handlers"
@type handler :: atom | {atom, term} | {pid, reference}
@type handler :: atom | {atom, term}
@doc false
defmacro __using__(_) do
+5 -1
View File
@@ -77,7 +77,7 @@ defimpl Enumerable, for: Range do
{:done, acc}
end
def member?(first .. last, value) do
def member?(first .. last, value) when is_integer(value) do
validate_range!(first, last)
if first <= last do
{:ok, first <= value and value <= last}
@@ -86,6 +86,10 @@ defimpl Enumerable, for: Range do
end
end
def member?(_ .. _, _value) do
{:ok, false}
end
def count(first .. last) do
validate_range!(first, last)
if first <= last do
+5 -3
View File
@@ -353,7 +353,9 @@ defmodule ExUnit.Assertions do
defp pinned_vars([]), do: ""
defp pinned_vars(pins) do
content = Enum.map(pins, fn(var) ->
content = Enum.reverse(pins)
|> Enum.uniq_by(&elem(&1, 0))
|> Enum.map(fn(var) ->
binary = Macro.to_string(var)
quote do
"\n " <> unquote(binary) <> " = " <> inspect(unquote(var))
@@ -361,7 +363,7 @@ defmodule ExUnit.Assertions do
end)
quote do
"\nThe following variables were pinned:" <> unquote_splicing(content)
<<"\nThe following variables were pinned:", unquote_splicing(content)>>
end
end
@@ -384,7 +386,7 @@ defmodule ExUnit.Assertions do
assert_raise ArithmeticError, "bad argument in arithmetic expression", fn ->
1 + "test"
end
assert_raise RuntimeError, ~r/^Today's lucky number is 0\.\d+!$/, fn ->
raise "Today's lucky number is #{:random.uniform}!"
end
@@ -127,6 +127,46 @@ defmodule ExUnit.AssertionsTest do
end
end
test "assert received with multiple identical pinned variables" do
status = :valid
send self(), {:status, :invalid, :invalid}
try do
"This should never be tested" = assert_received {
:status,
^status,
^status
}
rescue
error in [ExUnit.AssertionError] ->
"No message matching {:status, ^status, ^status} after 0ms.\n" <>
"The following variables were pinned:\n" <>
" status = :valid\n" <>
"Process mailbox:\n" <>
" {:status, :invalid, :invalid}" = error.message
end
end
test "assert received with multiple unique pinned variables" do
status = :valid
other_status = :invalid
send self(), {:status, :invalid, :invalid}
try do
"This should never be tested" = assert_received {
:status,
^status,
^other_status
}
rescue
error in [ExUnit.AssertionError] ->
"No message matching {:status, ^status, ^other_status} after 0ms.\n" <>
"The following variables were pinned:\n" <>
" status = :valid\n" <>
" other_status = :invalid\n" <>
"Process mailbox:\n" <>
" {:status, :invalid, :invalid}" = error.message
end
end
test "assert received when empty mailbox" do
try do
"This should never be tested" = assert_received :hello
+4 -2
View File
@@ -282,7 +282,7 @@ defmodule Mix.Project do
app = config[:app] ->
Path.join([build_path(config), "lib", Atom.to_string(app)])
config[:apps_path] ->
Mix.raise "Trying to access app_path for an umbrella project but umbrellas have no app"
raise "Trying to access app_path for an umbrella project but umbrellas have no app"
true ->
Mix.raise "Cannot access build without an application name, " <>
"please ensure you are in a directory with a mix.exs file and it defines " <>
@@ -314,7 +314,9 @@ defmodule Mix.Project do
"""
def compile(args, config \\ config()) do
if config[:build_embedded] do
if not File.exists?(compile_path(config)) do
path = if umbrella?(config), do: build_path(config), else: compile_path(config)
unless File.exists?(path) do
Mix.raise "Cannot execute task because the project was not yet compiled. " <>
"When build_embedded is set to true, \"MIX_ENV=#{Mix.env} mix compile\" " <>
"must be explicitly executed"
+2
View File
@@ -1,6 +1,8 @@
defmodule Mix.Tasks.App.Start do
use Mix.Task
# Do not mark this task as recursive as it is
# responsible for loading consolidated protocols.
@shortdoc "Starts all registered apps"
@moduledoc """
+1 -1
View File
@@ -1,6 +1,6 @@
{application, elixir,
[{description, "elixir"},
{vsn, "1.1.0"},
{vsn, "1.1.1"},
{modules, [
elixir
]},