Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
CIP_TAG: ${{ matrix.cip_tag }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Bootstrap CIP
run: |
Expand All @@ -54,7 +54,7 @@ jobs:
cip cache-key

- name: Cache CPAN modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cip
key: ${{ runner.os }}-build-${{ steps.cache-key.outputs.key }}
Expand Down
65 changes: 0 additions & 65 deletions .github/workflows/macos.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/windows.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Test::Script ![linux](https://github.com/uperl/Test-Script/workflows/linux/badge.svg) ![macos](https://github.com/uperl/Test-Script/workflows/macos/badge.svg) ![windows](https://github.com/uperl/Test-Script/workflows/windows/badge.svg)
# Test::Script ![linux](https://github.com/uperl/Test-Script/workflows/linux/badge.svg)

Basic cross-platform tests for scripts

Expand Down
2 changes: 0 additions & 2 deletions dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ test2_v0 = 1
github_user = uperl

workflow = linux
workflow = macos
workflow = windows

[RemovePrereqs]
remove = strict
Expand Down
10 changes: 6 additions & 4 deletions lib/Test/Script.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use 5.008001;
use strict;
use warnings;
use Carp qw( croak );
use Exporter;
use Exporter ();
use File::Spec;
use File::Spec::Unix;
use Probe::Perl;
Expand Down Expand Up @@ -82,7 +82,7 @@ our @EXPORT = qw{
};

sub import {
my $self = shift;
my $class = shift;
my $pack = caller;
if(defined $_[0] && $_[0] =~ /^(?:no_plan|skip_all|tests)$/)
{
Expand All @@ -103,8 +103,10 @@ sub import {
}
$ctx->release;
}
foreach ( @EXPORT ) {
$self->export_to_level(1, $self, $_);
else
{
unshift @_, $class;
goto &Exporter::import;
}
}

Expand Down
90 changes: 90 additions & 0 deletions t/bug_gh45.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
use Test2::V0 -no_srand => 1;
use Test::Script ();

is(
\@Test::Script::EXPORT,
bag {
item $_ for qw(
script_compiles
script_compiles_ok
script_fails
script_runs
script_stdout_is
script_stdout_isnt
script_stdout_like
script_stdout_unlike
script_stderr_is
script_stderr_isnt
script_stderr_like
script_stderr_unlike
program_fails
program_runs
program_stdout_is
program_stdout_isnt
program_stdout_like
program_stdout_unlike
program_stderr_is
program_stderr_isnt
program_stderr_like
program_stderr_unlike
);
etc;
},
'the list of exports contains at least the functions that was defined when this test was created',
);

not_imported_ok(qw(
script_compiles
script_compiles_ok
script_fails
script_runs
script_stdout_is
script_stdout_isnt
script_stdout_like
script_stdout_unlike
script_stderr_is
script_stderr_isnt
script_stderr_like
script_stderr_unlike
program_fails
program_runs
program_stdout_is
program_stdout_isnt
program_stdout_like
program_stdout_unlike
program_stderr_is
program_stderr_isnt
program_stderr_like
program_stderr_unlike
),
);

Test::Script->import('script_compiles', 'script_runs');

imported_ok('script_compiles','script_runs');

not_imported_ok(qw(
script_compiles_ok
script_fails
script_stdout_is
script_stdout_isnt
script_stdout_like
script_stdout_unlike
script_stderr_is
script_stderr_isnt
script_stderr_like
script_stderr_unlike
program_fails
program_runs
program_stdout_is
program_stdout_isnt
program_stdout_like
program_stdout_unlike
program_stderr_is
program_stderr_isnt
program_stderr_like
program_stderr_unlike
),
);

done_testing;
Loading