Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Misc. Triq improvements, inclusing statem fixes. #3

Merged
merged 6 commits into from

2 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 8, 2011
  1. @eriksoe

    Minor fixes

    authored eriksoe committed
    - export binary/0 in triq.hrl
    - eliminate min warnings in R14
  2. @eriksoe

    Fix bug with operator preference in debug code

    authored eriksoe committed
  3. @eriksoe
  4. @eriksoe

    Merge branch 'master' of git@github.com:eriksoe/triq

    eriksoe authored
    Conflicts:
    	include/triq.hrl
  5. @eriksoe

    Added triq_statem.hrl .

    eriksoe authored
  6. @eriksoe

    Statem-related bugfixes: Make eval/2 work (type mismatch); return non…

    eriksoe authored
    …-symbolic state from run_commands.
This page is out of date. Refresh to see the latest.
View
1  include/triq.hrl
@@ -60,6 +60,7 @@
%%
-import(?DOMAIN_MODULE, [list/1, tuple/1, int/0, real/0, elements/1, any/0, atom/0,
choose/2, bool/0, char/0, oneof/1, return/1, vector/2, binary/0, binary/1,
+ non_empty/1,
shrink_without_duplicates/1, resize/2, frequency/1]).
View
22 include/triq_statem.hrl
@@ -0,0 +1,22 @@
+%%
+%% This file is part of Triq - Trifork QuickCheck
+%%
+%% Copyright (c) 2011 by Trifork
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+
+-import(triq_statem, [commands/1,
+ run_commands/2, run_commands/3,
+ state_after/2,
+ prop_statem/1]).
View
4 src/triq_dom.erl
@@ -827,6 +827,8 @@ bound_shrink(#?DOM{kind=#bound_domain{dom1=Dom1,val1=Val1,dom2=Dom2,fun2=Fun,siz
%% @doc support function for `?LETSHRINK([X,...],[domain(),...],domain())'
%% @private
+bindshrink(Dom,_Fun) when not is_list(Dom) ->
+ error(argument_to_LETSHRINK_macro_must_be_lists);
bindshrink(Dom,Fun) when is_function(Fun,1) ->
domain(letshrink,
fun(_,SampleSize) ->
@@ -1244,7 +1246,7 @@ eval(PropList, Tuple) when is_tuple(Tuple) ->
A = eval(PropList, Args),
erlang:apply(M,F,A);
- [var, Name] when is_atom(Name) ->
+ [var, Name] when is_integer(Name) ->
case proplists:lookup(Name, PropList) of
none -> {var, Name};
{Name, Value} -> Value
View
4 src/triq_statem.erl
@@ -130,7 +130,7 @@ run_commands(Module,Commands,Env) ->
do_run_command(Commands, Env, Module, History, State) ->
case Commands of
[] ->
- {History, State, ok};
+ {History, eval(Env,State), ok};
[{init,S}|Rest] ->
State2 = eval(Env, S),
@@ -153,7 +153,7 @@ do_run_command(Commands, Env, Module, History, State) ->
do_run_command(Rest, Env2, Module, History2, State2);
Other ->
- {History, State, {postcondition, Other}}
+ {History, eval(Env,State), {postcondition, Other}}
end
end.
Something went wrong with that request. Please try again.