Permalink
Browse files

Support for R16B

The following changes have been made to satisfy the R16B
compiler:
- type definitions were moved to from .hrl to respective .erl files;
- leading '.' were removed.
  • Loading branch information...
1 parent b5c73ce commit a51a561f74f9d14594c613e80b42d0c4a188fef5 @horkhe horkhe committed Mar 26, 2013
Showing with 26 additions and 13 deletions.
  1. +2 −1 .travis.yml
  2. +1 −6 include/hamcrest_internal.hrl
  3. +3 −3 priv/build/templates/hamcrest.hrl.src
  4. +6 −0 src/hamcrest.erl
  5. +11 −0 src/hamcrest_matchers.erl
  6. +3 −3 test/test.hrl
View
@@ -1,5 +1,6 @@
language: erlang
otp_release:
- - R15B01
+ - R15B02
+ - R16B
before_script: "make build"
script: "make test"
@@ -32,11 +32,6 @@
desc = "" :: term()
}).
--type(matchfun(A) :: fun((A) -> boolean())).
--opaque(matchspec() :: #'hamcrest.matchspec'{}).
-
--type(container_t() :: list() | set() | gb_set()).
-
-define(MATCHER(MatchFun, Expected, Desc),
#'hamcrest.matchspec'{
matcher=MatchFun,
@@ -45,6 +40,6 @@
}).
-define(HECKLE(M,F,A),
- .application:set_env(hamcrest, heckle, [M, F, A])).
+ application:set_env(hamcrest, heckle, [M, F, A])).
-define(NOHECKLE, application:unset_env(hamcrest, heckle)).
@@ -37,7 +37,7 @@
((fun () ->
case (hamcrest:assert_that(Value, MatchSpec)) of
true -> true;
- __V -> .erlang:error({assertion_failed,
+ __V -> erlang:error({assertion_failed,
[{module, ?MODULE},
{line, ?LINE},
{expected, true},
@@ -50,7 +50,7 @@
fun() ->
case (hamcrest:assert_that(Value, MatchSpec)) of
true -> true;
- __V -> .erlang:error({assertion_failed,
+ __V -> erlang:error({assertion_failed,
[{module, ?MODULE},
{line, ?LINE},
{expected, true},
@@ -63,7 +63,7 @@ end).
((fun () ->
case (hamcrest:assert_that(Value, MatchSpec, After)) of
true -> true;
- __V -> .erlang:error({assertion_failed,
+ __V -> erlang:error({assertion_failed,
[{module, ?MODULE},
{line, ?LINE},
{expected, true},
View
@@ -45,6 +45,12 @@
heckle/2]).
%%%============================================================================
+%%% Types
+%%%============================================================================
+
+-opaque matchspec() :: #'hamcrest.matchspec'{}.
+
+%%%============================================================================
%%% API
%%%============================================================================
@@ -70,6 +70,17 @@
check_isempty/1,
check_member/2]).
+%%%============================================================================
+%%% Types
+%%%============================================================================
+
+-type matchfun(A) :: fun((A) -> boolean()).
+-type container_t() :: list() | set() | gb_set().
+
+%%%============================================================================
+%%% API
+%%%============================================================================
+
-spec(will_fail/0 :: () -> hamcrest:matchspec()).
will_fail() ->
%% Matcher :: fun((fun(() -> any())) -> boolean())
View
@@ -46,7 +46,7 @@
-define(assertException(Class, Term, Expr),
((fun () ->
try (Expr) of
- __V -> .erlang:error({assertException_failed,
+ __V -> erlang:error({assertException_failed,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??Expr)},
@@ -57,7 +57,7 @@
catch
Class:Term -> ok;
__C:__T ->
- .erlang:error({assertException_failed,
+ erlang:error({assertException_failed,
[{module, ?MODULE},
{line, ?LINE},
{expression, (??Expr)},
@@ -66,7 +66,7 @@
++" , [...] }"},
{unexpected_exception,
{__C, __T,
- .erlang:get_stacktrace()}}]})
+ erlang:get_stacktrace()}}]})
end
end)())).

0 comments on commit a51a561

Please sign in to comment.