#! /usr/bin/perl -w ## ---------------------------------------------------------------------------- # t/01-basic.t # ----------------------------------------------------------------------------- # Mastering programmed by YAMASHINA Hio # # Copyright 2006 YAMASHINA Hio # ----------------------------------------------------------------------------- # $Id: /perl/Text-OutdentEdge/t/01-basic.t 251 2006-11-25T09:34:10.153482Z hio $ # ----------------------------------------------------------------------------- use strict; use warnings; use Test::More tests => 15; use Text::OutdentEdge qw(xoutdent outdent); &test01_xoutdent; #2. &test02_xoutdent2; #2. &test03_utils; #6. &test04_outdent; #4. &test05_outdent2; #1. # ----------------------------------------------------------------------------- # xoutdent. # sub test01_xoutdent { my $in = <1}), "1\n2\n", "[utils] trimming explicit"); is(outdent($in,{trim=>0}), "\n1\n2\n", "[utils] no trimming"); is(outdent($in,{chomp=>1}), "1\n2", "[utils] chomp"); is(outdent(" \n"), " \n", "[utils] spaces only line is skipped"); } # ----------------------------------------------------------------------------- # outdent. # sub test04_outdent { my $in = <qr/ /}), " test.\n", "[outdent] specify indent by opts"); } # ----------------------------------------------------------------------------- # multi indents. # sub test05_outdent2 { my $in = <