test-e-k-k.px
来自「一个从网络上自动下载文件的自由工具」· PX 代码 · 共 90 行
PX
90 行
#!/usr/bin/perl -wuse strict;use HTTPTest;###############################################################################my $mainpage = <<EOF;<html><head> <title>Main Page Title</title></head><body> <a href="http://localhost:8080/subpage.php">Secondary Page</a></body></html>EOFmy $mainpagemangled = <<EOF;<html><head> <title>Main Page Title</title></head><body> <a href="subpage.php.html">Secondary Page</a></body></html>EOFmy $subpage = <<EOF;<html><head> <title>Secondary Page Title</title></head><body> <p>Some text</p></body></html>EOF# code, msg, headers, contentmy %urls = ( '/index.php' => { code => "200", msg => "Dontcare", headers => { "Content-type" => "text/html", }, content => $mainpage, }, '/subpage.php' => { code => "200", msg => "Dontcare", headers => { "Content-type" => "text/html", }, content => $subpage, },);my $cmdline = $WgetTest::WGETPATH . " -d -r -nd -E -k -K http://localhost:8080/index.php";my $expected_error_code = 0;my %expected_downloaded_files = ( 'index.php.orig' => { content => $mainpage, }, 'index.php.html' => { content => $mainpagemangled, }, 'subpage.php.html' => { content => $subpage, },);###############################################################################my $the_test = HTTPTest->new (name => "Test-E-k-K", input => \%urls, cmdline => $cmdline, errcode => $expected_error_code, output => \%expected_downloaded_files);exit $the_test->run();# vim: et ts=4 sw=4
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?