NOT FINISHED: Ticket #3000: (size_trunc_len) generates incorrect result in some cases.

(size_trunc_len): deep reimplementation.

Add tests for size_trunc_len().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>