Commit Graph
2473 Commits
Author SHA1 Message Date
Alexei Sholik 707b965d21 Use singular names for time units, as in Erlang/OTP 19.1. Fix #5236 (#5244) 2016-09-22 23:28:13 +03:00
Aleksei Magusev 80ad6279cf Remove unnecessary whitespaces in "colors" test for IO.ANSI 2016-09-21 23:41:00 +02:00
José Valim 131146fe8b Remove Kernel.rand/0 and Kernel.rand/1
Since Enum.random/1 already provides the Kernel.rand/1
functionality.
2016-09-21 23:39:33 +02:00
James Fish cac2958bbc Update dialyzer tests for OTP-19.1/dialyzer-3.0.2 2016-09-21 15:31:46 +01:00
ToadJamb fce82df3d7 Add light foreground and background colors to IO.ANSI (#5231) 2016-09-20 11:09:24 +02:00
Aleksei Magusev 6a17102b0b Tidy up Enum.concat/1,2 tests 2016-09-20 00:57:54 +02:00
Vitalii Elenhaupt 5fcc79aee9 Extended test suite for Enum.concat/2 (#5229) 2016-09-19 11:32:28 +02:00
Aleksei Magusev 4bd47dbd96 Return given value value in Module.put_attribute/3 (#5218) 2016-09-15 11:12:02 +02:00
José Valim 1ac0b75755 Add DateTime.from_naive/2 2016-09-15 10:09:31 +02:00
José Valim 00f30e23e9 Keep markdown formatting on IO.ANSI.Docs
The previous format would use | before code blocks
and would remove # from headings, we have reverted
those changes to make the printed documentation and
help be closer to what it would look on source while
providing more information (in the case of headings).
2016-09-13 22:05:49 +02:00
José Valim 46ad7a5f9e Ensure take/2 does not consume next element on suspend 2016-09-11 00:05:53 +02:00
Michał Muskała a3c373f192 Introduce Process.send_after/4 (#5182) 2016-09-07 22:39:12 +02:00
José Valim bb4dd418b6 Correctly use stack name in all commands 2016-09-07 14:06:13 +02:00
José Valim c241252272 Avoid naming conflicts 2016-09-07 13:53:00 +02:00
José Valim 75937ba2ae Ensure lhs of in/2 is expanded only once 2016-09-07 13:35:40 +02:00
José Valim 550abc1c1e Add Kernel.rand/0 and Kernel.rand/1
Thanks to Hal Fulton for the proposal and original code.
2016-09-07 13:07:52 +02:00
Andrea Leopardi d7900b780f Wrap fn calls in parens in Macro.to_string/1 (#5170)
Right now, application of anonymous function literals in
Macro.to_string/2 is represented like this:

    iex> Macro.to_string(quote do: (fn x -> x end).(1))
    "fn x -> x end.(1)"

While this is valid, I think it's far more common to have such calls
with the literal fn wrapped in parens:

    (fn x -> x end).(1)

This commit makes Macro.to_string/2 behave like this.
2016-08-28 17:34:59 +02:00
Andrea Leopardi bd4a190141 Improve UndefinedFunctionError when using macros without require (#5156) 2016-08-26 23:51:25 +02:00
Andrea Leopardi 53705bdfd4 Don't crash in macro_exported?/3 when dealing with Erlang modules (#5165)
Right now, Kernel.macro_exported?/3 blindly calls __info__/1 on the
given module, but since __info__/1 is defined by Elixir when compiling
modules, this breaks if an Erlang module is passed to
macro_exported?/3. This commit fixes this behaviour by always returning
"false" in macro_exported?/3 when an Erlang module is given.
2016-08-26 20:20:58 +02:00
Aleksei Magusev ed9bfd3c7f Fix {Enum, Stream}.map_every/3 behaviour when nth is 0 2016-08-19 23:37:40 +02:00
Aleksei Magusev fc988a2ab1 Fix DateTime.from_unix!/2 to actually raise ArgumentError 2016-08-19 22:47:03 +02:00
José Valim 2cb2bb80ff Refactor and optimize aggregations over lists 2016-08-15 22:02:28 +02:00
Myron Marston e3c5b5d739 Add min/2, max/2 and min_max/2 to Enum (#5140) 2016-08-15 21:30:21 +02:00
Michał Muskała 3f25c3ce9b Make sure bad remote call errors have file/line info (#5116)
Change how we mark the generated AST for suppressing dialyzer errors -
instead of [generated: true, location: 0], we provide proper line number.
This means, however, that on OTP 18, those nodes won't be recognized
as generated and warnings will be issued.
It was decided that proper error messages are more important than
avoiding bogus dialyzer warnings.
The old mark for generated code is left in places that made compiler
issue warnings on 18.

The bad remote call dialyzer warnings can be suppressed with the
@dialyzer :no_fail_call
module attribute.
2016-08-15 13:18:09 +01:00
Otto Lin fa678123f1 Support Enum.map_every/3 and Stream.map_every/3 (#5141) 2016-08-14 14:27:14 +02:00
Aleksei Magusev 5efd42cf28 Rename args -> argv in OptionParserTest 2016-08-13 14:08:37 +02:00
Aleksei Magusev 70f30c9df2 Use String.to_existing_atom/1 for option conversion (#5134) 2016-08-13 14:06:48 +02:00
Aleksei Magusev 3bc6459c26 Remove trailing period in error message for missing terminator 2016-08-13 00:44:49 +02:00
Qqwy 9a5ef4ea84 Implements Integer.mod/2 and Integer.floor_div/2 (#5117) 2016-08-12 16:06:20 +02:00
Qqwy cd9204c73d Enhancement: negative integer support in DateTime.from_unix (#5128) 2016-08-12 16:03:27 +02:00
José Valim d5c85f1a45 Remove duplicate parallel compiler tests 2016-08-11 17:58:32 +02:00
James Fish e5ebb8deff Use dialyzer attributes instead of ExUnit exclude tag (#5131) 2016-08-11 16:51:42 +01:00
Milton Mazzarri 1686c2a7c4 Do not re-compile a compiled pattern for String.split/3 (#5127) 2016-08-11 09:46:54 +02:00
ottolin 916f104031 Enhancing error message for token matching failure (#5123) 2016-08-10 13:55:03 +02:00
Aleksei Magusev 5415722b02 Base List.delete_at/2 on List.pop_at/3 2016-08-10 11:02:05 +02:00
Aleksei Magusev 16e4a5a1eb Introduce List.pop_at/3 2016-08-10 11:02:02 +02:00
Aleksei Magusev 0ca7c53fe6 Standardize test names in ListTest 2016-08-10 01:08:05 +02:00
Aleksei Magusev ec050683cf Remove irrelevant test in ListTest 2016-08-10 01:06:52 +02:00
José Valim e5f700d5ff Properly splice binaries inside binaries 2016-08-09 01:38:01 +02:00
Aleksei Magusev 3dd1d8662a Tidy up Enum.slice/2,3 tests for ranges, improve record test formatting 2016-08-06 12:04:26 +02:00
Aleksei Magusev 5f12c746f0 Revise Enum.slice/2,3 implementation
This commit also fixes behaviour with descending ranges.
2016-08-06 01:48:52 +02:00
Eric Entin 7c74f4a5e9 Do not wait for self in parallel compiler (#5086) 2016-08-03 20:07:45 +02:00
José Valim c5c754c34f Use unique names in via tests 2016-07-30 11:44:03 +02:00
Christopher 1ad7b54e45 Fix String.split when parts and trim is used (#5077) 2016-07-30 10:53:36 +02:00
Eugene Pirogov 9baddf8379 Raise on incorrect digits in Integer.undigits/2 (#5068) 2016-07-27 16:11:17 +02:00
Michał Muskała 6dfe70c57a Mark struct update syntax as generated (#5067)
With changes to OTP 19, dialyzer started emitting warnings for
the struct update syntax where variable could only be that struct.
For example:

    def foo(%Foo{} = struct), do: %Foo{struct | bar: :baz}
2016-07-27 11:26:45 +02:00
Eksperimental 7d75249058 Optimize Enum.split_with/2 for lists (#5057)
+ examples added to docs
2016-07-26 00:26:43 +02:00
Andrea Leopardi f53c2db3d1 Be more strict with the type of @moduledoc, @typedoc, and @doc (#5051) 2016-07-22 22:14:45 +02:00
José Valim 924f3a4df7 Add tests for :via on Supervisor and GenServer 2016-07-22 22:13:23 +02:00
Andrea Leopardi 5d150c0c97 Deprecate some functions here and there for v1.4 (#5039) 2016-07-20 20:16:42 +02:00