Hello community,
here is the log from the commit of package perl-Test-Mock-Time for
openSUSE:Factory checked in at 2018-01-24 15:30:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-Mock-Time (Old)
and /work/SRC/openSUSE:Factory/.perl-Test-Mock-Time.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Mock-Time"
Wed Jan 24 15:30:11 2018 rev:2 rq:568398 version:0.1.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Test-Mock-Time/perl-Test-Mock-Time.changes
2017-09-22 21:34:13.833980038 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Test-Mock-Time.new/perl-Test-Mock-Time.changes
2018-01-24 15:30:16.175021076 +0100
@@ -1,0 +2,9 @@
+Wed Jan 10 07:20:09 UTC 2018 - [email protected]
+
+- updated to 0.1.7
+ see /usr/share/doc/packages/perl-Test-Mock-Time/Changes
+
+ v0.1.7 2018-01-09 21:05:29 EET
+ - Add support for perl-5.8.
+
+-------------------------------------------------------------------
Old:
----
Test-Mock-Time-v0.1.6.tar.gz
New:
----
Test-Mock-Time-v0.1.7.tar.gz
cpanspec.yml
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Test-Mock-Time.spec ++++++
--- /var/tmp/diff_new_pack.xFxpjc/_old 2018-01-24 15:30:17.426962524 +0100
+++ /var/tmp/diff_new_pack.xFxpjc/_new 2018-01-24 15:30:17.430962336 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Test-Mock-Time
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: perl-Test-Mock-Time
-Version: 0.1.6
+Version: 0.1.7
Release: 0
%define cpan_name Test-Mock-Time
Summary: Deterministic time & timers for event loop tests
@@ -25,6 +25,7 @@
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Test-Mock-Time/
Source0:
https://cpan.metacpan.org/authors/id/P/PO/POWERMAN/%{cpan_name}-v%{version}.tar.gz
+Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
++++++ Test-Mock-Time-v0.1.6.tar.gz -> Test-Mock-Time-v0.1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/Build.PL
new/Test-Mock-Time-v0.1.7/Build.PL
--- old/Test-Mock-Time-v0.1.6/Build.PL 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/Build.PL 2018-01-09 20:05:32.000000000 +0100
@@ -1,7 +1,7 @@
-# This Build.PL for Test-Mock-Time was generated by
Dist::Zilla::Plugin::ModuleBuildTiny 0.014.
+# This Build.PL for Test-Mock-Time was generated by
Dist::Zilla::Plugin::ModuleBuildTiny 0.015.
use strict;
use warnings;
-use 5.010001;
+use 5.008001;
use Module::Build::Tiny 0.034;
Build_PL();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/Changes
new/Test-Mock-Time-v0.1.7/Changes
--- old/Test-Mock-Time-v0.1.6/Changes 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/Changes 2018-01-09 20:05:32.000000000 +0100
@@ -1,5 +1,8 @@
Revision history for Test-Mock-Time
+v0.1.7 2018-01-09 21:05:29 EET
+ - Add support for perl-5.8.
+
v0.1.6 2016-02-29 23:22:56 EET
- Reformat doc.
- Drop support for Mojolicious < 6.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/MANIFEST
new/Test-Mock-Time-v0.1.7/MANIFEST
--- old/Test-Mock-Time-v0.1.6/MANIFEST 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/MANIFEST 2018-01-09 20:05:32.000000000 +0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v5.043.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.008.
Build.PL
Changes
LICENSE
@@ -16,7 +16,7 @@
t/EV.t
t/Mojolicious-EV.t
t/Mojolicious.t
-t/Time::HiRes.t
+t/TimeHiRes.t
t/author-perlcritic.t
t/author-pod-syntax.t
t/release-distribution.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/META.json
new/Test-Mock-Time-v0.1.7/META.json
--- old/Test-Mock-Time-v0.1.6/META.json 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/META.json 2018-01-09 20:05:32.000000000 +0100
@@ -4,13 +4,13 @@
"Alex Efros <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 5.043, Dist::Milla version v1.0.15,
CPAN::Meta::Converter version 2.150005",
+ "generated_by" : "Dist::Milla version v1.0.17, Dist::Zilla version 6.008,
CPAN::Meta::Converter version 2.150010",
"license" : [
"mit"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : 2
+ "version" : "2"
},
"name" : "Test-Mock-Time",
"no_index" : {
@@ -27,11 +27,14 @@
"configure" : {
"requires" : {
"Module::Build::Tiny" : "0.034"
+ },
+ "suggests" : {
+ "JSON::PP" : "2.27300"
}
},
"develop" : {
"requires" : {
- "Dist::Milla" : "v1.0.15",
+ "Dist::Milla" : "v1.0.17",
"Test::Distribution" : "0",
"Test::Perl::Critic" : "0",
"Test::Pod" : "1.41"
@@ -44,14 +47,14 @@
"Scalar::Util" : "0",
"Test::MockModule" : "0",
"bignum" : "0",
- "perl" : "5.010001"
+ "perl" : "5.008001"
}
},
"test" : {
"recommends" : {
"EV" : "0",
"Mojolicious" : "6",
- "Time::HiRes" : "0"
+ "Time::HiRes" : "1.9724"
},
"requires" : {
"Test::Exception" : "0",
@@ -65,7 +68,7 @@
"provides" : {
"Test::Mock::Time" : {
"file" : "lib/Test/Mock/Time.pm",
- "version" : "v0.1.6"
+ "version" : "v0.1.7"
}
},
"release_status" : "stable",
@@ -80,6 +83,10 @@
"web" : "https://github.com/powerman/perl-Test-Mock-Time"
}
},
- "version" : "v0.1.6"
+ "version" : "v0.1.7",
+ "x_contributors" : [
+ "Dagfinn Ilmari Manns\u00e5ker <[email protected]>"
+ ],
+ "x_serialization_backend" : "JSON::XS version 3.04"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/META.yml
new/Test-Mock-Time-v0.1.7/META.yml
--- old/Test-Mock-Time-v0.1.6/META.yml 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/META.yml 2018-01-09 20:05:32.000000000 +0100
@@ -8,7 +8,7 @@
configure_requires:
Module::Build::Tiny: '0.034'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 5.043, Dist::Milla version v1.0.15,
CPAN::Meta::Converter version 2.150005'
+generated_by: 'Dist::Milla version v1.0.17, Dist::Zilla version 6.008,
CPAN::Meta::Converter version 2.150010'
license: mit
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,16 +25,19 @@
provides:
Test::Mock::Time:
file: lib/Test/Mock/Time.pm
- version: v0.1.6
+ version: v0.1.7
requires:
Export::Attrs: '0'
List::Util: '1.33'
Scalar::Util: '0'
Test::MockModule: '0'
bignum: '0'
- perl: '5.010001'
+ perl: '5.008001'
resources:
bugtracker: https://github.com/powerman/perl-Test-Mock-Time/issues
homepage: https://github.com/powerman/perl-Test-Mock-Time
repository: https://github.com/powerman/perl-Test-Mock-Time.git
-version: v0.1.6
+version: v0.1.7
+x_contributors:
+ - 'Dagfinn Ilmari Mannsåker <[email protected]>'
+x_serialization_backend: 'YAML::Tiny version 1.70'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/README
new/Test-Mock-Time-v0.1.7/README
--- old/Test-Mock-Time-v0.1.6/README 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/README 2018-01-09 20:05:32.000000000 +0100
@@ -4,7 +4,7 @@
VERSION
- This document describes Test::Mock::Time version v0.1.5
+ This document describes Test::Mock::Time version v0.1.7
SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/cpanfile
new/Test-Mock-Time-v0.1.7/cpanfile
--- old/Test-Mock-Time-v0.1.6/cpanfile 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/cpanfile 2018-01-09 20:05:32.000000000 +0100
@@ -1,4 +1,4 @@
-requires 'perl', '5.010001';
+requires 'perl', '5.008001';
requires 'Export::Attrs';
requires 'List::Util', '1.33';
@@ -13,7 +13,7 @@
on test => sub {
requires 'Test::Exception';
requires 'Test::More', '0.96';
- recommends 'Time::HiRes';
+ recommends 'Time::HiRes', '1.9724';
recommends 'EV';
recommends 'Mojolicious', '6';
suggests 'AnyEvent';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/lib/Test/Mock/Time.pm
new/Test-Mock-Time-v0.1.7/lib/Test/Mock/Time.pm
--- old/Test-Mock-Time-v0.1.6/lib/Test/Mock/Time.pm 2016-02-29
22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/lib/Test/Mock/Time.pm 2018-01-09
20:05:32.000000000 +0100
@@ -1,11 +1,11 @@
package Test::Mock::Time;
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
use Carp;
-our $VERSION = 'v0.1.6';
+our $VERSION = 'v0.1.7';
use Export::Attrs;
use List::Util qw( any );
@@ -92,9 +92,10 @@
goto &ff;
}
+{
+my $next_id = 0;
sub _add_timer {
my ($loop, $after, $repeat, $cb, $watcher) = @_;
- state $next_id = 0;
my $id = sprintf 'fake_%05d', $next_id++;
push @Timers, {
id => $id,
@@ -110,6 +111,7 @@
}
return $id;
}
+}
sub _start_timer {
my ($watcher) = @_;
@@ -137,11 +139,11 @@
return int($Absolute + $Relative);
});
$Module{'CORE::GLOBAL'}->mock(localtime => sub (;$) {
- my $time = $_[0] // int($Absolute + $Relative);
+ my $time = defined $_[0] ? $_[0] : int($Absolute + $Relative);
return CORE::localtime($time);
});
$Module{'CORE::GLOBAL'}->mock(gmtime => sub (;$) {
- my $time = $_[0] // int($Absolute + $Relative);
+ my $time = defined $_[0] ? $_[0] : int($Absolute + $Relative);
return CORE::gmtime($time);
});
$Module{'CORE::GLOBAL'}->mock(sleep => sub ($) {
@@ -341,7 +343,9 @@
});
$Module{'EV::Timer'}->mock(set => sub {
my ($w, $after, $repeat) = @_;
- $repeat //= 0;
+ if (!defined $repeat) {
+ $repeat = 0;
+ }
my ($timer) = grep { $_->{watcher} && $_->{watcher} eq $w } @Timers,
@Timers_ns;
if ($timer) {
$timer->{start} = $Relative;
@@ -366,7 +370,7 @@
my ($active) = grep { $_->{watcher} && $_->{watcher} eq $w } @Timers;
my ($inactive) = grep { $_->{watcher} && $_->{watcher} eq $w }
@Timers_ns;
if ($active) {
- $active->{repeat} = sprintf '%.6f', $repeat // $active->{repeat};
+ $active->{repeat} = sprintf '%.6f', defined $repeat ? $repeat :
$active->{repeat};
if ($active->{repeat} > 0) {
$active->{after} = $active->{repeat};
$active->{start} = $Relative;
@@ -376,7 +380,7 @@
}
}
elsif ($inactive) {
- $inactive->{repeat} = sprintf '%.6f', $repeat //
$inactive->{repeat};
+ $inactive->{repeat} = sprintf '%.6f', defined $repeat ? $repeat :
$inactive->{repeat};
if ($inactive->{repeat} > 0) {
$inactive->{after} = $inactive->{repeat};
$inactive->{start} = $Relative;
@@ -503,7 +507,7 @@
=head1 VERSION
-This document describes Test::Mock::Time version v0.1.6
+This document describes Test::Mock::Time version v0.1.7
=head1 SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/AnyEvent.t
new/Test-Mock-Time-v0.1.7/t/AnyEvent.t
--- old/Test-Mock-Time-v0.1.6/t/AnyEvent.t 2016-02-29 22:22:58.000000000
+0100
+++ new/Test-Mock-Time-v0.1.7/t/AnyEvent.t 2018-01-09 20:05:32.000000000
+0100
@@ -1,4 +1,4 @@
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/CORE.t
new/Test-Mock-Time-v0.1.7/t/CORE.t
--- old/Test-Mock-Time-v0.1.6/t/CORE.t 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/CORE.t 2018-01-09 20:05:32.000000000 +0100
@@ -1,4 +1,4 @@
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/EV.t
new/Test-Mock-Time-v0.1.7/t/EV.t
--- old/Test-Mock-Time-v0.1.6/t/EV.t 2016-02-29 22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/EV.t 2018-01-09 20:05:32.000000000 +0100
@@ -1,4 +1,4 @@
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/Mojolicious-EV.t
new/Test-Mock-Time-v0.1.7/t/Mojolicious-EV.t
--- old/Test-Mock-Time-v0.1.6/t/Mojolicious-EV.t 2016-02-29
22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/Mojolicious-EV.t 2018-01-09
20:05:32.000000000 +0100
@@ -1,4 +1,4 @@
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/Mojolicious.t
new/Test-Mock-Time-v0.1.7/t/Mojolicious.t
--- old/Test-Mock-Time-v0.1.6/t/Mojolicious.t 2016-02-29 22:22:58.000000000
+0100
+++ new/Test-Mock-Time-v0.1.7/t/Mojolicious.t 2018-01-09 20:05:32.000000000
+0100
@@ -1,4 +1,4 @@
-use 5.010001;
+use 5.008001;
use warnings;
use strict;
use utf8;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/Time::HiRes.t
new/Test-Mock-Time-v0.1.7/t/Time::HiRes.t
--- old/Test-Mock-Time-v0.1.6/t/Time::HiRes.t 2016-02-29 22:22:58.000000000
+0100
+++ new/Test-Mock-Time-v0.1.7/t/Time::HiRes.t 1970-01-01 01:00:00.000000000
+0100
@@ -1,74 +0,0 @@
-use 5.010001;
-use warnings;
-use strict;
-use utf8;
-use Test::More;
-use Test::Exception;
-
-use Test::Mock::Time;
-
-BEGIN {
- plan skip_all => 'Time::HiRes not installed' if !eval { require
Time::HiRes };
- Time::HiRes->import(qw( time gettimeofday sleep usleep nanosleep ));
- eval { Time::HiRes->import(qw( CLOCK_REALTIME CLOCK_MONOTONIC
clock_gettime clock_getres )) };
- eval { Time::HiRes->import(qw( CLOCK_REALTIME CLOCK_MONOTONIC
clock_nanosleep )) };
-}
-
-my $t = time;
-cmp_ok $t, '>', 1455000000, 'time looks like current actual time';
-like $t, qr/\A\d+\z/ms, 'time is initially integer';
-select undef,undef,undef,1.1;
-is time, $t, 'time is same after real 1.1 second delay';
-is time(), $t, 'time() is same';
-
-SKIP: {
- skip 'clock_gettime(): unimplemented in this platform', 4 if !exists
&clock_gettime;
-
- is clock_gettime(CLOCK_REALTIME()), $t, 'clock_gettime(CLOCK_REALTIME) is
same';
- cmp_ok clock_gettime(CLOCK_MONOTONIC()), '<', $t,
'clock_gettime(CLOCK_MONOTONIC) < time()';
- cmp_ok clock_gettime(CLOCK_MONOTONIC()), '>', 0,
'clock_gettime(CLOCK_MONOTONIC) > 0';
- is clock_gettime(42), -1, 'clock_gettime(42) is not supported';
-}
-
-SKIP: {
- skip 'clock_getres(): unimplemented in this platform', 3 if !exists
&clock_getres;
-
- isnt clock_getres(CLOCK_REALTIME()), -1, 'clock_getres(CLOCK_REALTIME) is
supported';
- isnt clock_getres(CLOCK_MONOTONIC()), -1, 'clock_getres(CLOCK_MONOTONIC)
is supported';
- is clock_getres(42), -1, 'clock_getres(42) is not supported';
-}
-
-is scalar gettimeofday(), $t, 'gettimeofday is same as scalar';
-is_deeply [gettimeofday()], [$t,0], 'gettimeofday is same as array';
-
-throws_ok { sleep -0.5 } qr/Time::HiRes::sleep\(-0.5\): negative time not
invented yet/ms;
-throws_ok { sleep } qr/sleep without arg is not supported/ms;
-sleep 0.5;
-is time, $t+=0.5, 'time is increased by 0.5';
-is scalar gettimeofday(), $t, 'gettimeofday is increased by 0.5 as scalar';
-is_deeply [gettimeofday()], [$t-0.5,500000], 'gettimeofday is increased by 0.5
as array';
-
-throws_ok { usleep(-1) } qr/Time::HiRes::usleep\(-1\): negative time not
invented yet/ms;
-usleep(10_000);
-is time, $t+=0.01, 'time is increased by 0.01';
-
-throws_ok { nanosleep(-2) } qr/Time::HiRes::nanosleep\(-2\): negative time not
invented yet/ms;
-nanosleep(2_000_000);
-is time, $t+=0.002, 'time is increased by 0.002';
-
-SKIP: {
- skip 'clock_nanosleep(): unimplemented in this platform', 4 if !exists
&clock_nanosleep;
-
- throws_ok { clock_nanosleep(CLOCK_REALTIME(), -3) }
qr/Time::HiRes::clock_nanosleep\(..., -3\): negative time not invented yet/ms;
- throws_ok { clock_nanosleep(42, 1) } qr/only CLOCK_REALTIME and
CLOCK_MONOTONIC are supported/ms;
- throws_ok { clock_nanosleep(CLOCK_MONOTONIC(), 1, 1) } qr/only flags=0 is
supported/ms;
- clock_nanosleep(CLOCK_REALTIME(), 1_500_000);
- clock_nanosleep(CLOCK_MONOTONIC(), 1_500_000, 0);
- is time, $t+=0.003, 'time is increased by 0.003';
-}
-
-ff(1000.5);
-is time, $t+=1000.5, 'time is increased by 1000.5 after ff(1000.5)';
-
-
-done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/TimeHiRes.t
new/Test-Mock-Time-v0.1.7/t/TimeHiRes.t
--- old/Test-Mock-Time-v0.1.6/t/TimeHiRes.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Test-Mock-Time-v0.1.7/t/TimeHiRes.t 2018-01-09 20:05:32.000000000
+0100
@@ -0,0 +1,74 @@
+use 5.008001;
+use warnings;
+use strict;
+use utf8;
+use Test::More;
+use Test::Exception;
+
+use Test::Mock::Time;
+
+BEGIN {
+ plan skip_all => 'Time::HiRes not installed' if !eval { require
Time::HiRes };
+ Time::HiRes->import(qw( time gettimeofday sleep usleep nanosleep ));
+ eval { Time::HiRes->import(qw( CLOCK_REALTIME CLOCK_MONOTONIC
clock_gettime clock_getres )) };
+ eval { Time::HiRes->import(qw( CLOCK_REALTIME CLOCK_MONOTONIC
clock_nanosleep )) };
+}
+
+my $t = time;
+cmp_ok $t, '>', 1455000000, 'time looks like current actual time';
+like $t, qr/\A\d+\z/ms, 'time is initially integer';
+select undef,undef,undef,1.1;
+is time, $t, 'time is same after real 1.1 second delay';
+is time(), $t, 'time() is same';
+
+SKIP: {
+ skip 'clock_gettime(): unimplemented in this platform', 4 if !exists
&clock_gettime;
+
+ is clock_gettime(CLOCK_REALTIME()), $t, 'clock_gettime(CLOCK_REALTIME) is
same';
+ cmp_ok clock_gettime(CLOCK_MONOTONIC()), '<', $t,
'clock_gettime(CLOCK_MONOTONIC) < time()';
+ cmp_ok clock_gettime(CLOCK_MONOTONIC()), '>', 0,
'clock_gettime(CLOCK_MONOTONIC) > 0';
+ is clock_gettime(42), -1, 'clock_gettime(42) is not supported';
+}
+
+SKIP: {
+ skip 'clock_getres(): unimplemented in this platform', 3 if !exists
&clock_getres;
+
+ isnt clock_getres(CLOCK_REALTIME()), -1, 'clock_getres(CLOCK_REALTIME) is
supported';
+ isnt clock_getres(CLOCK_MONOTONIC()), -1, 'clock_getres(CLOCK_MONOTONIC)
is supported';
+ is clock_getres(42), -1, 'clock_getres(42) is not supported';
+}
+
+is scalar gettimeofday(), $t, 'gettimeofday is same as scalar';
+is_deeply [gettimeofday()], [$t,0], 'gettimeofday is same as array';
+
+throws_ok { sleep -0.5 } qr/Time::HiRes::sleep\(-0.5\): negative time not
invented yet/ms;
+throws_ok { sleep } qr/sleep without arg is not supported/ms;
+sleep 0.5;
+is time, $t+=0.5, 'time is increased by 0.5';
+is scalar gettimeofday(), $t, 'gettimeofday is increased by 0.5 as scalar';
+is_deeply [gettimeofday()], [$t-0.5,500000], 'gettimeofday is increased by 0.5
as array';
+
+throws_ok { usleep(-1) } qr/Time::HiRes::usleep\(-1\): negative time not
invented yet/ms;
+usleep(10_000);
+is time, $t+=0.01, 'time is increased by 0.01';
+
+throws_ok { nanosleep(-2) } qr/Time::HiRes::nanosleep\(-2\): negative time not
invented yet/ms;
+nanosleep(2_000_000);
+is time, $t+=0.002, 'time is increased by 0.002';
+
+SKIP: {
+ skip 'clock_nanosleep(): unimplemented in this platform', 4 if !exists
&clock_nanosleep;
+
+ throws_ok { clock_nanosleep(CLOCK_REALTIME(), -3) }
qr/Time::HiRes::clock_nanosleep\(..., -3\): negative time not invented yet/ms;
+ throws_ok { clock_nanosleep(42, 1) } qr/only CLOCK_REALTIME and
CLOCK_MONOTONIC are supported/ms;
+ throws_ok { clock_nanosleep(CLOCK_MONOTONIC(), 1, 1) } qr/only flags=0 is
supported/ms;
+ clock_nanosleep(CLOCK_REALTIME(), 1_500_000);
+ clock_nanosleep(CLOCK_MONOTONIC(), 1_500_000, 0);
+ is time, $t+=0.003, 'time is increased by 0.003';
+}
+
+ff(1000.5);
+is time, $t+=1000.5, 'time is increased by 1000.5 after ff(1000.5)';
+
+
+done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/author-perlcritic.t
new/Test-Mock-Time-v0.1.7/t/author-perlcritic.t
--- old/Test-Mock-Time-v0.1.6/t/author-perlcritic.t 2016-02-29
22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/author-perlcritic.t 2018-01-09
20:05:32.000000000 +0100
@@ -2,8 +2,8 @@
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for testing by the author');
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/author-pod-syntax.t
new/Test-Mock-Time-v0.1.7/t/author-pod-syntax.t
--- old/Test-Mock-Time-v0.1.6/t/author-pod-syntax.t 2016-02-29
22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/author-pod-syntax.t 2018-01-09
20:05:32.000000000 +0100
@@ -2,8 +2,8 @@
BEGIN {
unless ($ENV{AUTHOR_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for testing by the author');
+ print qq{1..0 # SKIP these tests are for testing by the author\n};
+ exit
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Test-Mock-Time-v0.1.6/t/release-distribution.t
new/Test-Mock-Time-v0.1.7/t/release-distribution.t
--- old/Test-Mock-Time-v0.1.6/t/release-distribution.t 2016-02-29
22:22:58.000000000 +0100
+++ new/Test-Mock-Time-v0.1.7/t/release-distribution.t 2018-01-09
20:05:32.000000000 +0100
@@ -1,8 +1,8 @@
BEGIN {
unless ($ENV{RELEASE_TESTING}) {
- require Test::More;
- Test::More::plan(skip_all => 'these tests are for release candidate
testing');
+ print qq{1..0 # SKIP these tests are for release candidate testing\n};
+ exit
}
}
++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#description: |-
# override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
#preamble: |-
# BuildRequires: gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s, *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module