From dcf48593575c564f730b4adc2fc8a5726e676d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Hedenstro=CC=88m?= <erik@hedenstroem.com> Date: Tue, 10 Nov 2015 19:47:33 +0100 Subject: [PATCH] No dialyzer errors --- include/gurka.hrl | 6 +++--- src/gurka.erl | 2 +- src/gurka_parser.erl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/gurka.hrl b/include/gurka.hrl index 4129346..601b8b6 100644 --- a/include/gurka.hrl +++ b/include/gurka.hrl @@ -1,7 +1,7 @@ -type phase() :: feature | background | scenario | scenario_outline | meta. --type action() :: desc | title | given | 'when' | then | examples | headers | values | tags. --type tokens() :: [binary()]. --type row() :: pos_integer(). +-type action() :: skip | start | 'end' | desc | title | given | 'when' | then | examples | headers | values | tags | table | docstring. +-type tokens() :: [tokens() | binary() | {table, any()} | {docstring, any()}]. +-type row() :: integer(). -type meta() :: [{atom(),term()}]. -type lines() :: [{row(), binary(), tokens()}]. diff --git a/src/gurka.erl b/src/gurka.erl index 850fe74..4cf0e02 100644 --- a/src/gurka.erl +++ b/src/gurka.erl @@ -117,7 +117,7 @@ run(Module, Options, FeatureState, ScenarioState, _PreviousPhase, [Step = #step{ [{ok, Step} | run(Module, Options, FeatureState, ScenarioState, Phase, Steps)]. run_outline(Module, Options, FeatureState, ScenarioState, _PreviousPhase, [ExamplesStep = #step{phase = scenario_outline, action = examples, row = ExampleRow, tokens = [Headers | Rows]} | Steps], ScenarioOutline) -> - TaggedHeaders = [<<"<", Header/binary, ">">> || Header <- Headers], + TaggedHeaders = [<<"<", Header/binary, ">">> || Header <- Headers, is_binary(Header)], {Results, _} = lists:mapfoldl(fun(Row, Count) -> Example = lists:zip(TaggedHeaders, Row), Scenario = lists:foldl(fun(Step, ScenarioAcc) -> diff --git a/src/gurka_parser.erl b/src/gurka_parser.erl index 2d0c9a4..ff876a2 100644 --- a/src/gurka_parser.erl +++ b/src/gurka_parser.erl @@ -20,8 +20,8 @@ parse(File) -> end. -spec process(Phase, Action, Lines) -> Feature when - Phase :: phase(), - Action :: action(), + Phase :: phase() | undefined, + Action :: action() | undefined, Lines :: lines(), Feature :: feature(). process(_Phase, _Action, []) -> -- GitLab