Commit Graph
468 Commits
Author SHA1 Message Date
José Valim 658d7c7913 ExUnit callbacks must return :ok or { :ok, data } 2013-02-17 20:43:01 -07:00
José Valim 8f57b4c9af Add metadata support to ExUnit
Defining setup/teardown/test explicitly is now deprecated.
They should now be defined via their respective macros:

    def setup do
      ...
    end

Now becomes:

    setup do
      ...
    end

When defined using the new format, setup callbacks can
return metadata:

    setup do
      [do_this: :do_that]
    end

And now the test macro can access this metadata:

    test "check metadata", data do
      assert data[:do_this] == :do_that
    end
2013-02-17 18:23:31 -07:00
José Valim 5557e620ff Backwards incompatible change on before_compile and after_compile
Both callbacks now receive the environment as
first argument instead of the module.
2013-02-16 19:57:14 -07:00
José Valim 683153ef05 Switches are now overridden by default but can be kept in order if chosen, closes #782 2013-02-16 19:17:35 -07:00
José Valim 9ebce19f36 Push a test case related to the nested vars in clauses 2013-02-14 10:46:20 -07:00
Kim Shrier ced13c159f Change references or invocations of Process.self to Kernel.self 2013-02-09 15:41:09 -07:00
Yurii Rashkovskii d0dc9f5c2c Minor indentation fix 2013-02-06 10:32:26 -08:00
Yurii Rashkovskii 71e2252064 Unpack __block__ in type specs
Fixes #827
2013-02-05 11:18:49 -08:00
José Valim 28211b2714 Ensure aliases expansion also works for implicit aliases 2013-02-03 21:57:39 -07:00
José Valim 109c07e757 Improve aliases hygiene by using metadata 2013-02-03 15:12:38 -07:00
José Valim cd51c80362 Tidy up and clean up quote API, closes #814 2013-02-03 12:14:18 -07:00
Yurii Rashkovskii a1a576e9d1 Implement as_boolean/1 type
Closes #798
2013-02-03 10:40:35 -08:00
Yurii Rashkovskii 0123edd8a3 Better error reporting for invalid ANSI escape sequences 2013-02-02 14:25:10 -08:00
José Valim de3bd8ec86 Expand current module macros with Macro.expand, closes #815 2013-02-02 15:04:30 -07:00
Yurii Rashkovskii 3fea472cc2 IO.ANSI.escape shouldn't emit a reset sequence if no ANSI sequence was emitted
Closes #807
2013-02-02 13:02:51 -08:00
Yurii Rashkovskii 7cb18091d0 Better error reporting for invalid type specifications
Closes #818
2013-02-02 12:47:17 -08:00
José Valim 8994feb0a3 Fix unused vars warnings 2013-02-02 13:33:00 -07:00
José Valim 7196543060 Improve how aliases for defmodule are generated 2013-01-30 16:43:29 -07:00
José Valim fade5452e1 R16A fixes 2013-01-30 11:15:40 -07:00
José Valim 4d3d61e173 Deprecate :local.(args) syntax 2013-01-28 21:21:18 -07:00
José Valim d8aa534e3a Change IO.ANSI escape from #[] to %{} 2013-01-28 12:45:14 -07:00
José Valim 0f2dd3f7d4 Merge pull request #775 from yrashk/io-ansi
Initial IO.ANSI implementation (based on https://github.com/yrashk/ansiex)
2013-01-28 10:46:29 -08:00
José Valim 20942ee329 Better support for Unicode lists 2013-01-28 11:43:25 -07:00
José Valim 9e742e50dc Path.join merges second path regardless if it is an absolute or relative path
Closes #790
2013-01-27 18:00:58 -07:00
José Valim 67154735f7 Add Path.relative and Path.type 2013-01-27 15:15:25 -07:00
José Valim fef7ef7233 Ensure consistent use of stab operator in do/end, parens and fn/end, closes #780 2013-01-27 11:00:59 -07:00
Yurii Rashkovskii 2bfe0fe358 Implement integer -> size(integer) syntax shortcut for bitsyntax
Closes #795
2013-01-25 17:47:18 -08:00
José Valim ded17471fa Revert "Merge pull request #778 from alexrp/master"
There is still some discussion pending on this, see #791

This reverts commit f2d4d1e0b9, reversing
changes made to c524bcdeb2.
2013-01-24 13:43:34 -07:00
alexrp c459d31287 Use System.services_timeout/0 for kernel tests. 2013-01-23 16:42:34 +01:00
José Valim abb1ae981a Add hygienic imports to macros 2013-01-21 20:45:49 -07:00
José Valim b3747a28e1 Raise an exception if var!(x) does not expand to a proper var 2013-01-21 19:59:37 -07:00
José Valim 5bde00a9c7 Properly expand var! second argument 2013-01-21 18:50:40 -07:00
José Valim 9a62a43340 Aliases for defmodule also works for raw atoms 2013-01-21 18:40:10 -07:00
José Valim 89cbe93bba The AST now allows metadata to be attached to each node
This means the second item in the AST is no longer an integer
(representing the line), but a keywords list. Code that relies
on the line information from AST or that manually generate AST
nodes need to be properly updated.
2013-01-21 15:42:03 -07:00
José Valim b9cea6195f Check if native name encoding is utf8 2013-01-20 20:33:03 -07:00
José Valim bdb4afe99b String.capitalize now considers Unicode's titlecase property 2013-01-20 16:38:36 -07:00
José Valim 6df5dfc08c Ensure File.cwd works with utf-8 file names 2013-01-20 16:08:39 -07:00
Yurii Rashkovskii 50d375e33b IO.ANSI.escape implies terminating #[reset] now and IO.ANSI.escape_fragment has been introduced 2013-01-20 10:36:31 -08:00
José Valim a3d1ee67d7 Use the new Path.relative_to and ensure it won't fail for equals paths 2013-01-19 21:24:44 -07:00
Yurii Rashkovskii 119d48e093 Improve IO.ANSI test case so it can be run on non-terminals correctly 2013-01-19 20:22:16 -08:00
Yurii Rashkovskii 6960f856f4 Put proper IO.ANSI tests in 2013-01-19 20:17:59 -08:00
José Valim 204abb6761 Add System.tmp_dir, System.cwd and System.user_home 2013-01-19 21:12:33 -07:00
Yurii Rashkovskii eb11254369 Introduce IO.ANSI.escape/1,2 functions 2013-01-19 19:38:14 -08:00
Yurii Rashkovskii 80bd148852 Initial IO.ANSI implementation (based on https://github.com/yrashk/ansiex) 2013-01-19 15:28:35 -08:00
José Valim 689bce1e9a Inspect should represent non valid terms with # 2013-01-19 12:19:28 -07:00
Yurii Rashkovskii 2297fc1c48 Improve Binary.Inspect for Function test 2013-01-19 11:12:47 -08:00
Yurii Rashkovskii 2e10c3d24d When possible, represent functions in a literal way 2013-01-19 11:00:36 -08:00
José Valim cb1b4c5bc5 Add Path.absname and expand ~ on Path.expand 2013-01-19 10:32:33 -07:00
José Valim fda6f0ce09 Move path related functions from File to Path 2013-01-19 09:36:03 -07:00
José Valim 173c0cfb5f Deprecate OrdDict and Binary.Dict 2013-01-18 16:39:24 -07:00