prettyprint: fix length limit to be 'maximum length before truncation'.

db4
John Benediktsson 2013-03-20 15:30:29 -07:00
parent da1931317d
commit d5e5991671
2 changed files with 2 additions and 7 deletions

View File

@ -196,7 +196,7 @@ M: tuple pprint*
: do-length-limit ( seq -- trimmed n/f )
length-limit get dup [
over length over [-]
1 - over length over [-]
dup 1 > [ [ head-slice ] dip ] [ 2drop f ] if
] when ;

View File

@ -465,12 +465,7 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ;
with-string-writer
] unit-test
{ "{ 0 1 2 3 4 5 }" } [
{ "{ 0 1 2 3 ~2 more~ }" } [
[ 5 length-limit [ 6 iota >array pprint ] with-variable ]
with-string-writer
] unit-test
{ "{ 0 1 2 3 4 ~2 more~ }" } [
[ 5 length-limit [ 7 iota >array pprint ] with-variable ]
with-string-writer
] unit-test