File: 20-elide.t

package info (click to toggle)
libstring-escape-perl 2010.002-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 164 kB
  • sloc: perl: 362; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 409 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use Test;
BEGIN { plan tests => 4, todo => [] }

use String::Escape qw( elide );

my ( $original, $altered, $comparison );

$original = "Now is the time for all good folk to party.";

ok( elide( $original, 10 ) eq 'Now is...');

ok( elide( $original, 15 ) eq 'Now is the...');

ok( elide( $original, 10, 0 ) eq 'Now is ...');

ok( elide( $original, 15, 0 ) eq 'Now is the t...');