Skip to content

Commit

Permalink
test:Better test skipping.
Browse files Browse the repository at this point in the history
  • Loading branch information
antononcube committed Nov 15, 2023
1 parent 84fc01e commit a478e11
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 43 deletions.
21 changes: 11 additions & 10 deletions t/01-copy-to-clipboard.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ use Test;

plan *;

unless $*DISTRO.name ~~ /macos/ {
skip-rest "MacOS specific tests";
exit;
}
if $*DISTRO.name ~~ /macos/ {

## 1
my $s1 = "3433";
is-deeply copy-to-clipboard($s1), $s1;

## 1
my $s1 = "3433";
is-deeply copy-to-clipboard($s1), $s1;
## 2
my %h2 = g => 3, b => 565;
is-deeply copy-to-clipboard(%h2), %h2;

## 2
my %h2 = g => 3, b => 565;
is-deeply copy-to-clipboard(%h2), %h2;
} else {
skip "Only MacOS specific tests.";
}

done-testing;
35 changes: 18 additions & 17 deletions t/02-from-clipboard.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,22 @@ use Test;

plan *;

unless $*DISTRO.name ~~ /macos/ {
skip-rest "MacOS specific tests";
exit;
}

## 1
my $s1 = "3433";
copy-to-clipboard($s1);
is paste().trim, $s1;
if $*DISTRO.name ~~ /macos/ {

## 1
my $s1 = "3433";
copy-to-clipboard($s1);
is paste().trim, $s1;

## 2
my %h2 = g => 3, b => 565;
copy-to-clipboard(%h2);
#is paste().trim, %h2.raku;
is paste().trim, '${:b(565), :g(3)}';
## 2
my %h2 = g => 3, b => 565;
copy-to-clipboard(%h2);
#is paste().trim, %h2.raku;
is paste().trim, '${:b(565), :g(3)}';

## 3
my $s3 = q:to/END/;
## 3
my $s3 = q:to/END/;
my %dictionary = (
cat => 'a small domesticated carnivorous mammal',
dog => 'a domesticated carnivorous mammal',
Expand All @@ -35,7 +33,10 @@ my %dictionary = (
);
END

copy-to-clipboard($s3);
is-deeply paste.trim, $s3.trim;
copy-to-clipboard($s3);
is-deeply paste.trim, $s3.trim;
} else {
skip "Only MacOS specific tests.";
}

done-testing;
33 changes: 17 additions & 16 deletions t/03-synonyms.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ use Test;

plan *;

unless $*DISTRO.name ~~ /macos/ {
skip-rest "MacOS specific tests";
exit;
}
if $*DISTRO.name ~~ /macos/ {

## 1
my $s1 = "3433";
cbcopy($s1);
is cbpaste().trim, $s1;
## 1
my $s1 = "3433";
cbcopy($s1);
is cbpaste().trim, $s1;

## 2
my %h2 = g => 3, b => 565;
cbcopy(%h2);
is cbpaste().trim, '${:b(565), :g(3)}';
## 2
my %h2 = g => 3, b => 565;
cbcopy(%h2);
is cbpaste().trim, '${:b(565), :g(3)}';

## 3
my $s3 = q:to/END/;
## 3
my $s3 = q:to/END/;
my %dictionary = (
cat => 'a small domesticated carnivorous mammal',
dog => 'a domesticated carnivorous mammal',
Expand All @@ -34,7 +31,11 @@ my %dictionary = (
);
END

cbcopy($s3);
is-deeply cbpaste.trim, $s3.trim;
cbcopy($s3);
is-deeply cbpaste.trim, $s3.trim;

} else {
skip "Only MacOS specific tests.";
}

done-testing;

0 comments on commit a478e11

Please sign in to comment.