From 66fc7953796f7f7cabf84653267b6e8e6fddfa9c Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 3 Jul 2010 16:28:58 +0200 Subject: [PATCH] lib/i3test: use custom import() instead of Test::Kit to also import v5.10 --- testcases/t/lib/i3test.pm | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/testcases/t/lib/i3test.pm b/testcases/t/lib/i3test.pm index f3a9a2e5..cf4baccc 100644 --- a/testcases/t/lib/i3test.pm +++ b/testcases/t/lib/i3test.pm @@ -1,25 +1,15 @@ package i3test; # vim:ts=4:sw=4:expandtab -use Test::Kit qw( - Test::Exception - Data::Dumper - AnyEvent::I3 -), - 'Test::Deep' => { - exclude => [ qw(all) ], - }; - use File::Temp qw(tmpnam); use X11::XCB::Rect; use X11::XCB::Window; use X11::XCB qw(:all); use AnyEvent::I3; use List::Util qw(first); -# Test::Kit already uses Exporter -#use Exporter qw(import); -use base 'Exporter'; +use v5.10; +use Exporter (); our @EXPORT = qw(get_workspace_names get_unused_workspace get_ws_content get_ws get_focused); BEGIN { @@ -29,6 +19,23 @@ BEGIN { } } +sub import { + my $class = shift; + my $pkg = caller; + eval "package $pkg; +use Test::More qw(@_); +use Test::Exception; +use Data::Dumper; +use AnyEvent::I3; +use Test::Deep qw(eq_deeply cmp_deeply cmp_set cmp_bag cmp_methods useclass noclass set bag subbagof superbagof subsetof supersetof superhashof subhashof bool str arraylength Isa ignore methods regexprefonly regexpmatches num regexponly scalref reftype hashkeysonly blessed array re hash regexpref hash_each shallow array_each code arrayelementsonly arraylengthonly scalarrefonly listmethods any hashkeys isa); +use v5.10; +use strict; +use warnings; +"; + @_ = ($class); + goto \&Exporter::import; +} + sub open_standard_window { my ($x) = @_;