Skip to content

Commit

Permalink
Decrease prio of max/re clauses from 50->51 so the human result can b…
Browse files Browse the repository at this point in the history
…e a nicer "at least X, at most Y" instead of "at most Y, at least X"
  • Loading branch information
sharyanto committed Jan 18, 2013
1 parent fdb759c commit 3cc8040
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Data/Sah/Type/HasElems.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Data::Sah::Util::Role 'has_clause';
requires 'superclause_has_elems';

has_clause 'max_len',
prio => 51,
arg => ['int*' => {min=>0}],
allow_expr => 1,
code => sub {
Expand Down
2 changes: 2 additions & 0 deletions lib/Data/Sah/Type/Sortable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ has_clause 'xmin',
},
;
has_clause 'max',
prio => 51,
tags => ['constraint'],
arg => 'any*',
allow_expr => 1,
Expand All @@ -35,6 +36,7 @@ has_clause 'max',
},
;
has_clause 'xmax',
prio => 51,
tags => ['constraint'],
arg => 'any*',
allow_expr => 1,
Expand Down
2 changes: 2 additions & 0 deletions lib/Data/Sah/Type/hash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ has_clause "keys",
},
;
has_clause "re_keys",
prio => 51,
tags => ['constraint'],
arg => ['hash*' => {keys => 're*', values => 'schema*'}],
allow_expr => 0,
Expand All @@ -47,6 +48,7 @@ has_clause "allowed_keys",
allow_expr => 1,
;
has_clause "allowed_keys_re",
prio => 51,
tags => ['constraint'],
arg => 're*',
allow_expr => 1,
Expand Down

0 comments on commit 3cc8040

Please sign in to comment.