diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index 0acb26680f..b43387d93e 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -195,7 +195,7 @@ M: tuple pprint* : do-length-limit ( seq -- trimmed n/f ) length-limit get dup [ over length over [-] - dup zero? [ 2drop f ] [ [ head-slice ] dip ] if + [ drop f ] [ [ head-slice ] dip ] if-zero ] when ; : pprint-elements ( seq -- ) diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index f89d44440a..79d0a664c1 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -455,3 +455,13 @@ TUPLE: fo { a intersection{ integer fixnum } initial: 0 } ; ] [ [ maybe{ maybe{ integer } } . ] with-string-writer ] unit-test + +{ "{ 0 1 2 3 4 }" } [ + [ 5 length-limit [ 5 iota >array pprint ] with-variable ] + with-string-writer +] unit-test + +{ "{ 0 1 2 3 4 ~1 more~ }" } [ + [ 5 length-limit [ 6 iota >array pprint ] with-variable ] + with-string-writer +] unit-test