Skip to content

Commit

Permalink
1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 20, 2022
1 parent 4dccdf5 commit 7cfd832
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,4 +1,6 @@
Revision history for Games-TauStation-DateTime

{{$NEXT}}

1.1 2022-05-20T13:09:51+02:00
- First version in the zef ecosystem
4 changes: 3 additions & 1 deletion META6.json
Expand Up @@ -17,7 +17,9 @@
"resources": [
],
"source-url": "https://github.com/raku-community-modules/Games-TauStation-DateTime.git",
"tags": [ "TAUSTATION", "SPACE"
"tags": [
"TAUSTATION",
"SPACE"
],
"test-depends": [
],
Expand Down
5 changes: 4 additions & 1 deletion t/00-use.rakutest
@@ -1,4 +1,7 @@
use lib 'lib';
use Test;

plan 1;

use-ok 'Games::TauStation::DateTime';

# vim: expandtab shiftwidth=4
4 changes: 3 additions & 1 deletion t/01-basic.rakutest
@@ -1,8 +1,8 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

plan 15;

isa-ok GCT, DateTime;

is-deeply GCT.new('198.14/07:106GCT'),
Expand Down Expand Up @@ -42,3 +42,5 @@ is-approx GCT.new('D /07:106 GCT').Instant.Rat, :$abs-tol,
'D /07:106 GC';
is-approx GCT.new('D-/07:106 GCT').Instant.Rat, :$abs-tol,
GCT.now.earlier(:7segments).earlier(:106units).Instant.Rat;

# vim: expandtab shiftwidth=4
4 changes: 3 additions & 1 deletion t/02-later.rakutest
@@ -1,8 +1,8 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

plan 31;

with GCT.new: '100.18/05:407 GCT' {
is .later( :cycle), '101.18/05:407 GCT', ':cycle';
is .later(:3cycles), '103.18/05:407 GCT', ':3cycles';
Expand Down Expand Up @@ -63,3 +63,5 @@ with GCT.new: '100.18/05:407 GCT' {
is .later(:years(-10020)), GCT.new('-36497.11/94:612 GCT'),
':years(-10020)';
}

# vim: expandtab shiftwidth=4
4 changes: 3 additions & 1 deletion t/03-earlier.rakutest
@@ -1,8 +1,8 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

plan 31;

with GCT.new: '100.18/05:407 GCT' {
is .earlier( :cycle), '099.18/05:407 GCT', ':cycle';
is .earlier(:3cycles), '097.18/05:407 GCT', ':3cycles';
Expand Down Expand Up @@ -62,3 +62,5 @@ with GCT.new: '100.18/05:407 GCT' {
.earlier(:units(-60*60*24*(30*4+31*7+29)/.864)),
':years(-1)';
}

# vim: expandtab shiftwidth=4
3 changes: 2 additions & 1 deletion t/04-convertion-to-OE.rakutest
@@ -1,4 +1,3 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

Expand All @@ -19,3 +18,5 @@ for ^100 {
is-deeply GCT.new($t).DateTime, DateTime.new($t),
".DateTime with time $t";
}

# vim: expandtab shiftwidth=4
4 changes: 3 additions & 1 deletion t/05-stringification.rakutest
@@ -1,4 +1,3 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

Expand All @@ -11,4 +10,7 @@ plan +my @dates = (
~ ':' ~ (^1000 .pick.fmt: '%03d') ~ ' GCT'}),
«'100.18/05:407 GCT' '000.18/05:407 GCT' '100.99/99:999 GCT'»
).flat;

is GCT.new($_), $_, $_ for @dates;

# vim: expandtab shiftwidth=4
3 changes: 2 additions & 1 deletion t/06-durations.rakutest
@@ -1,4 +1,3 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

Expand All @@ -12,3 +11,5 @@ is-approx GCT.new('D21.18/65:437 GCT' ).Instant.Rat, :$abs-tol,
is-approx GCT.new('D-21.18/65:437 GCT' ).Instant.Rat, :$abs-tol,
GCT.now.earlier(:21cycles).earlier(:18days).earlier(:65segments)
.earlier(:437units).Instant.Rat, 'earlier';

# vim: expandtab shiftwidth=4
3 changes: 2 additions & 1 deletion t/07-partials.rakutest
@@ -1,4 +1,3 @@
use lib 'lib';
use Test;
use Games::TauStation::DateTime;

Expand All @@ -22,3 +21,5 @@ is-approx GCT.new('D8/65:437 GCT' ).Instant.Rat, :$abs-tol,
GCT.new('D000.08/65:437 GCT').Instant.Rat, 'DXXX.X';
is-approx GCT.new('D/65:437 GCT' ).Instant.Rat, :$abs-tol,
GCT.new('D000.00/65:437 GCT').Instant.Rat, 'DXXX.XX';

# vim: expandtab shiftwidth=4

0 comments on commit 7cfd832

Please sign in to comment.