2023-11-15 18:15:55 +00:00
|
|
|
use v6.d;
|
|
|
|
use Humming-Bird::Core;
|
2023-11-15 18:41:48 +00:00
|
|
|
use Test;
|
2023-11-15 18:15:55 +00:00
|
|
|
# Local libs
|
|
|
|
use lib 'lib';
|
|
|
|
use Hyperlink-Redirect;
|
2023-11-15 18:41:48 +00:00
|
|
|
use Hyperlink-Redirect::Helpers;
|
|
|
|
|
|
|
|
plan 2;
|
2023-11-15 18:15:55 +00:00
|
|
|
|
2023-11-18 02:04:48 +00:00
|
|
|
ok fix-protocol("seriousbusiness.international") eq "http://seriousbusiness.international",
|
|
|
|
"fix-protocol fixes bare domains correctly"
|
|
|
|
or diag "\nfix-protocol should return the same string with 'http://' prefixed if protocol isn't specified";
|
2023-11-15 18:15:55 +00:00
|
|
|
|
2023-11-18 02:04:48 +00:00
|
|
|
ok fix-protocol("https://www.seriousbusiness.international") eq "https://www.seriousbusiness.international",
|
|
|
|
"fix-protocol does not mangle correctly formatted domains"
|
|
|
|
or diag "\nThe URL should remain unchanged when the protocol is specified";
|