Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/perl.com/example.com/ in examples and tests #81

Merged
merged 3 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
165 changes: 165 additions & 0 deletions .github/workflows/dzil-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
name: dzil build and test

on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: "15 4 * * 0" # Every Sunday morning

jobs:
build-job:
name: Build distribution
runs-on: ubuntu-20.04
container:
image: perldocker/perl-tester:5.32
steps:
- uses: actions/checkout@v2
- name: Run Tests
env:
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
EXTENDED_TESTING: 1
RELEASE_TESTING: 1
run: auto-build-and-test-dist
- uses: actions/upload-artifact@v2
with:
name: build_dir
path: build_dir
if: ${{ github.actor != 'nektos/act' }}
coverage-job:
needs: build-job
runs-on: ubuntu-20.04
container:
image: perldocker/perl-tester:5.32
steps:
- uses: actions/checkout@v2 # codecov wants to be inside a Git repository
- uses: actions/download-artifact@v2
with:
name: build_dir
path: .
- name: Install deps and test
run: cpan-install-dist-deps && test-dist
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
ubuntu-test-job:
needs: build-job
runs-on: "ubuntu-latest"
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
perl-version:
- "5.8"
- "5.10"
- "5.12"
- "5.14"
- "5.16"
- "5.18"
- "5.20"
- "5.22"
- "5.24"
- "5.26"
- "5.28"
- "5.30"
- "5.32"
name: perl ${{ matrix.perl-version }} on ${{ matrix.os }}
steps:
- name: set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl-version }}
- uses: actions/download-artifact@v2
with:
name: build_dir
path: .
- name: install deps using cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
args: "--with-suggests --with-recommends --with-test --with-develop"
- run: prove -lrv t xt
env:
AUTHOR_TESTING: 1
RELEASE_TESTING: 1
macos-test-job:
needs: ubuntu-test-job
runs-on: "macos-latest"
strategy:
fail-fast: true
matrix:
os: [macos-latest]
perl-version:
- "5.8"
- "5.10"
- "5.12"
- "5.14"
- "5.16"
- "5.18"
- "5.20"
- "5.22"
- "5.24"
- "5.26"
- "5.28"
- "5.30"
- "5.32"
name: perl ${{ matrix.perl-version }} on ${{ matrix.os }}
steps:
- name: set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl-version }}
- uses: actions/download-artifact@v2
with:
name: build_dir
path: .
- name: install deps using cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
args: "--with-suggests --with-recommends --with-test --with-develop"
- run: prove -lrv t xt
env:
AUTHOR_TESTING: 1
RELEASE_TESTING: 1
windows-test-job:
needs: ubuntu-test-job
runs-on: "windows-latest"
strategy:
fail-fast: true
matrix:
os: [windows-latest]
perl-version:
- "5.14"
- "5.16"
- "5.18"
- "5.20"
- "5.22"
- "5.24"
- "5.26"
- "5.28"
- "5.30"
name: perl ${{ matrix.perl-version }} on ${{ matrix.os }}
steps:
- name: set up perl
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: ${{ matrix.perl-version }}
distribution: strawberry # this option only used on windows
- uses: actions/download-artifact@v2
with:
name: build_dir
path: .
- name: install deps using cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
args: "--with-suggests --with-recommends --with-test"
- run: prove -lrv t
env:
AUTHOR_TESTING: 0
RELEASE_TESTING: 0
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Revision history for URI

{{$NEXT}}
- s/perl.com/example.com/ in examples and tests (GH#81) (Olaf Alders)

5.06 2021-01-14 16:01:13Z
- Tidy import statements (GH#80) (Olaf Alders)
Expand Down
14 changes: 13 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@ on 'configure' => sub {
};

on 'develop' => sub {
requires "Test::CPAN::Changes" => "0.19";
recommends 'Business::ISBN' => 0;
recommends "Storable" => "0";
requires "File::Spec" => "0";
requires "IO::Handle" => "0";
requires "IPC::Open3" => "0";
requires "Pod::Coverage::TrustPod" => "0";
requires "Test::CPAN::Meta" => "0";
requires "Test::MinimumVersion" => "0";
requires "Test::Mojibake" => "0";
requires "Test::More" => "0.94";
requires "Test::Pod" => "1.41";
requires "Test::Pod::Coverage" => "1.08";
requires "Test::Portability::Files" => "0";
requires "Test::Spelling" => "0.12";
requires "Test::Version" => "1";
};

on 'runtime' => sub {
Expand Down
8 changes: 4 additions & 4 deletions lib/URI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,13 @@ URI - Uniform Resource Identifiers (absolute and relative)

=head1 SYNOPSIS

use URI;
use URI ();

$u1 = URI->new("http://www.perl.com");
$u1 = URI->new("http://www.example.com");
$u2 = URI->new("foo", "http");
$u3 = $u2->abs($u1);
$u4 = $u3->clone;
$u5 = URI->new("HTTP://WWW.perl.com:80")->canonical;
$u5 = URI->new("HTTP://WWW.example.com:80")->canonical;

$str = $u->as_string;
$str = "$u";
Expand All @@ -374,7 +374,7 @@ URI - Uniform Resource Identifiers (absolute and relative)
$frag = $u->fragment;

$u->scheme("ftp");
$u->host("ftp.perl.com");
$u->host("ftp.example.com");
$u->path("cpan/");

=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/URI/Heuristic.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ URI::Heuristic - Expand URI using heuristics
=head1 SYNOPSIS

use URI::Heuristic qw(uf_uristr);
$u = uf_uristr("perl"); # http://www.perl.com
$u = uf_uristr("example"); # http://www.example.com
$u = uf_uristr("www.sol.no/sol"); # http://www.sol.no/sol
$u = uf_uristr("aas"); # http://www.aas.no
$u = uf_uristr("ftp.funet.fi"); # ftp://ftp.funet.fi
Expand Down
20 changes: 10 additions & 10 deletions t/http.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ print "1..16\n";

use URI ();

my $u = URI->new("<http://www.perl.com/path?q=f�o>");
my $u = URI->new("<http://www.example.com/path?q=f�o>");

#print "$u\n";
print "not " unless $u eq "http://www.perl.com/path?q=f%F4o";
print "not " unless $u eq "http://www.example.com/path?q=f%F4o";
print "ok 1\n";

print "not " unless $u->port == 80;
print "ok 2\n";

# play with port
my $old = $u->port(8080);
print "not " unless $old == 80 && $u eq "http://www.perl.com:8080/path?q=f%F4o";
print "not " unless $old == 80 && $u eq "http://www.example.com:8080/path?q=f%F4o";
print "ok 3\n";

$u->port(80);
print "not " unless $u eq "http://www.perl.com:80/path?q=f%F4o";
print "not " unless $u eq "http://www.example.com:80/path?q=f%F4o";
print "ok 4\n";

$u->port("");
print "not " unless $u eq "http://www.perl.com:/path?q=f%F4o" && $u->port == 80;
print "not " unless $u eq "http://www.example.com:/path?q=f%F4o" && $u->port == 80;
print "ok 5\n";

$u->port(undef);
print "not " unless $u eq "http://www.perl.com/path?q=f%F4o";
print "not " unless $u eq "http://www.example.com/path?q=f%F4o";
print "ok 6\n";

my @q = $u->query_form;
Expand All @@ -39,7 +39,7 @@ $u->query_form(foo => "bar", bar => "baz");
print "not " unless $u->query eq "foo=bar&bar=baz";
print "ok 8\n";

print "not " unless $u->host eq "www.perl.com";
print "not " unless $u->host eq "www.example.com";
print "ok 9\n";

print "not " unless $u->path eq "/path";
Expand All @@ -52,14 +52,14 @@ $u->scheme("https");
print "not " unless $u->port == 443;
print "ok 12\n";

print "not " unless $u eq "https://www.perl.com/path?foo=bar&bar=baz";
print "not " unless $u eq "https://www.example.com/path?foo=bar&bar=baz";
print "ok 13\n";

print "not " unless $u->secure;
print "ok 14\n";

$u = URI->new("http://%77%77%77%2e%70%65%72%6c%2e%63%6f%6d/%70%75%62/%61/%32%30%30%31/%30%38/%32%37/%62%6a%6f%72%6e%73%74%61%64%2e%68%74%6d%6c");
print "not " unless $u->canonical eq "http://www.perl.com/pub/a/2001/08/27/bjornstad.html";
$u = URI->new("http://%65%78%61%6d%70%6c%65%2e%63%6f%6d/%70%75%62/%61/%32%30%30%31/%30%38/%32%37/%62%6a%6f%72%6e%73%74%61%64%2e%68%74%6d%6c");
print "not " unless $u->canonical eq "http://example.com/pub/a/2001/08/27/bjornstad.html";
print "ok 15\n";

print "not " unless $u->has_recognized_scheme;
Expand Down
4 changes: 2 additions & 2 deletions t/rsync.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ print "1..4\n";

use URI ();

my $u = URI->new('rsync://gisle@perl.com/foo/bar');
my $u = URI->new('rsync://gisle@example.com/foo/bar');

print "not " unless $u->user eq "gisle";
print "ok 1\n";
Expand All @@ -18,6 +18,6 @@ print "ok 3\n";

$u->port(8730);

print "not " unless $u eq 'rsync://gisle@perl.com:8730/foo/bar';
print "not " unless $u eq 'rsync://gisle@example.com:8730/foo/bar';
print "ok 4\n";