⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.pl

📁 对cisco路由器的命令模拟
💻 PL
📖 第 1 页 / 共 2 页
字号:
CHAPTER ICall me Ishmael.  Some years ago--never mind how long precisely--  having little or no money in my purse, and nothing particular  to interest me on shore, I thought I would sail about a little  and see the watery part of the world.  It is a way I have  of driving off the spleen and regulating the circulation.  Whenever I find myself growing grim about the mouth;  whenever it is a damp, drizzly November in my soul; whenever I  find myself involuntarily pausing before coffin warehouses,  and bringing up the rear of every funeral I meet;  and especially whenever my hypos get such an upper hand of me,  that it requires a strong moral principle to prevent me from  deliberately stepping into the street, and methodically knocking  people's hats off--then, I account it high time to get to sea  as soon as I can.  This is my substitute for pistol and ball.  With a philosophical flourish Cato throws himself upon his sword;  I quietly take to the ship.  There is nothing surprising in this.  If they but knew it, almost all men in their degree,  some time or other, cherish very nearly the same feelings  towards the ocean with me.EOF$test8 = <<EOF;				      1851				   MOBY DICK;				  OR THE WHALE			       by Herman MelvilleETYMOLOGY(Supplied by a Late Consumptive Usher to a Grammar School)The pale Usher--threadbare in coat, heart, body, and brain;I see him now. He was ever dusting his old lexicons and grammars,with a queer handkerchief, mockingly embellished with all the gayflags of all the known nations of the world. He loved to dust hisold grammars; it somehow mildly reminded him of his mortality.CHAPTER ICall me Ishmael. Some years ago--never mind how long precisely--having little or no money in my purse, and nothing particularto interest me on shore, I thought I would sail about a littleand see the watery part of the world. It is a way I have of drivingoff the spleen and regulating the circulation. Whenever I findmyself growing grim about the mouth; whenever it is a damp,drizzly November in my soul; whenever I find myself involuntarilypausing before coffin warehouses, and bringing up the rear of everyfuneral I meet; and especially whenever my hypos get such an upperhand of me, that it requires a strong moral principle to preventme from deliberately stepping into the street, and methodicallyknocking people's hats off--then, I account it high time to getto sea as soon as I can. This is my substitute for pistol and ball.With a philosophical flourish Cato throws himself upon his sword;I quietly take to the ship. There is nothing surprising in this.If they but knew it, almost all men in their degree, some time or other,cherish very nearly the same feelings towards the ocean with me.EOF$test9 = <<EOF;1851 MOBY DICK; OR THE WHALE by Herman Melville ETYMOLOGY (Supplied bya Late Consumptive Usher to a Grammar School) The pale Usher--threadbare in coat, heart, body, and brain; I see him now.  He was everdusting his old lexicons and grammars, with a queer handkerchief,mockingly embellished with all the gay flags of all the knownnations of the world.  He loved to dust his old grammars; it somehowmildly reminded him of his mortality.  CHAPTER I Call me Ishmael.Some years ago--never mind how long precisely--having little or nomoney in my purse, and nothing particular to interest me on shore,I thought I would sail about a little and see the watery partof the world.  It is a way I have of driving off the spleenand regulating the circulation.  Whenever I find myself growinggrim about the mouth; whenever it is a damp, drizzly Novemberin my soul; whenever I find myself involuntarily pausing beforecoffin warehouses, and bringing up the rear of every funeral I meet;and especially whenever my hypos get such an upper hand of me,that it requires a strong moral principle to prevent me fromdeliberately stepping into the street, and methodically knockingpeople's hats off--then, I account it high time to get to seaas soon as I can.  This is my substitute for pistol and ball.With a philosophical flourish Cato throws himself upon his sword;I quietly take to the ship.  There is nothing surprising in this.If they but knew it, almost all men in their degree, some time or other,cherish very nearly the same feelings towards the ocean with me.EOF$test10 = <<EOF;				      1851				   MOBY DICK;				  OR THE WHALE			       by Herman MelvilleETYMOLOGY(Supplied by a Late Consumptive Usher to a Grammar School)The pale Usher--threadbare in coat, heart, body, and brain; I see       him now.  He was ever dusting his old lexicons and grammars,       with a queer handkerchief, mockingly embellished with all       the gay flags of all the known nations of the world.       He loved to dust his old grammars; it somehow mildly reminded       him of his mortality.CHAPTER ICall me Ishmael.  Some years ago--never mind how long precisely--       having little or no money in my purse, and nothing particular       to interest me on shore, I thought I would sail about a little       and see the watery part of the world.  It is a way I have       of driving off the spleen and regulating the circulation.       Whenever I find myself growing grim about the mouth;       whenever it is a damp, drizzly November in my soul; whenever I       find myself involuntarily pausing before coffin warehouses,       and bringing up the rear of every funeral I meet;       and especially whenever my hypos get such an upper hand of me,       that it requires a strong moral principle to prevent me from       deliberately stepping into the street, and methodically knocking       people's hats off--then, I account it high time to get to sea       as soon as I can.  This is my substitute for pistol and ball.       With a philosophical flourish Cato throws himself upon his sword;       I quietly take to the ship.  There is nothing surprising in this.       If they but knew it, almost all men in their degree,       some time or other, cherish very nearly the same feelings       towards the ocean with me.EOF$longword = <<EOF;A short paragraph with a long last word:****************************************************************************EOFopen(OUT, ">tmp1") or die "Can't write `tmp1': $!\n";print OUT $test1;close(OUT);test_reflow_file(2, $test2, "tmp1", "", 2, [65], 75);test_reflow_file(3, $test3, "tmp1", "CHAPTER", 2, [65], 75);test_reflow_file(4, $test4, "tmp1", "", 1, [65], 75);test_reflow_file(5, $test5, "tmp1", "", 2, [65, 70, 60], 75);unlink("tmp1");test_reflow_string(6, $test2, $test1, "", 2, [65], 75);test_reflow_string(7, $test3, $test1, "CHAPTER", 2, [65], 75);test_reflow_string(8, $test4, $test1, "", 1, [65], 75);test_reflow_string(9, $test5, $test1, "", 2, [65, 70, 60], 75);$tmp = $test1;chomp($tmp);@test1 = map { "$_\n" } split(/\n/, $tmp, -1);test_reflow_array(10, $test2, \@test1, "", 2, [65], 75);test_reflow_array(11, $test3, \@test1, "CHAPTER", 2, [65], 75);test_reflow_array(12, $test4, \@test1, "", 1, [65], 75);test_reflow_array(13, $test5, \@test1, "", 2, [65, 70, 60], 75);$_ = reflow_string($test1, indent => "> ", optimum => [65, 70, 60]);if ($_ eq $test6) {  print "ok 14\n";} else {  print "not ok 14\n";}$test99 = $_;$_ = reflow_string($test1, skipto => "  ETYMOLOGY", indent1 => "", indent2 => "  ",			   optimum => [65, 70, 60]);if ($_ eq $test7) {  print "ok 15\n";} else {  print "not ok 15\n";}$_ = reflow_string($test99, quote => '> ');if ($_ eq $test2) {  print "ok 16\n";} else {  print "not ok 16\n";}$_ = reflow_string($test1, frenchspacing => 'y');if ($_ eq $test8) {  print "ok 17\n";} else {  print "not ok 17\n";}$_ = reflow_string($test1, oneparagraph => 'y');if ($_ eq $test9) {  print "ok 18\n";} else {  print "not ok 18\n";}$_ = reflow_string($test1, indent1 => '', indent2 => "       ");if ($_ eq $test10) {  print "ok 19\n";} else {  print "not ok 19\n";}$_ = reflow_string($longword);if ($_ eq $longword) {  print "ok 20\n";} else {  print "not ok 20\n";}exit(0);sub test_reflow_file {  my ($n, $res, $input, $skipto, $skipindented, $optimum, $maximum) = @_;  reflow_file($input, "tmp2", skipto => $skipto, skipindented => $skipindented,			      optimum => $optimum, maximum => $maximum);  open(IN, "tmp2");  { local $/;    undef $/;    $_ = <IN>;  }  close(IN);  unlink("tmp2");  if ($_ eq $res) {    print "ok $n\n" ;  } else {    print "not ok $n\n";  }}sub test_reflow_string {  my ($n, $res, $input, $skipto, $skipindented, $optimum, $maximum) = @_;  local $_;  $_ = reflow_string($input, skipto => $skipto, skipindented => $skipindented,			     optimum => $optimum, maximum => $maximum);  if ($_ eq $res) {    print "ok $n\n" ;  } else {    print "not ok $n\n";  }}sub test_reflow_array {  my ($n, $res, $input, $skipto, $skipindented, $optimum, $maximum) = @_;  my $output;  $output = reflow_array($input, skipto => $skipto, skipindented => $skipindented,				 optimum => $optimum, maximum => $maximum);  $_ = join("", @$output);  if ($_ eq $res) {    print "ok $n\n" ;  } else {    print "not ok $n\n";  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -