Commit | Line | Data |
d6d18343 |
1 | |
5dcad11c |
2 | use strict; |
3 | use warnings; |
1680cce5 |
4 | |
3e2f4695 |
5 | use Test::More; |
ee9bf440 |
6 | use if $ENV{AUTHOR_TESTING}, 'Test::Warnings'; |
3e2f4695 |
7 | |
1680cce5 |
8 | use_ok('Devel::REPL'); |
9 | |
10 | my @plugins = qw/ |
11 | B::Concise |
12 | Colors |
13 | Commands |
14 | Completion |
15 | CompletionDriver::Globals |
16 | CompletionDriver::INC |
17 | CompletionDriver::Keywords |
18 | CompletionDriver::LexEnv |
19 | CompletionDriver::Methods |
20 | CompletionDriver::Turtles |
21 | DDC |
22 | DDS |
23 | DumpHistory |
24 | FancyPrompt |
25 | FindVariable |
26 | History |
27 | Interrupt |
28 | LexEnv |
29 | MultiLine::PPI |
30 | Nopaste |
31 | OutputCache |
32 | PPI |
33 | Packages |
34 | Peek |
35 | ReadLineHistory |
36 | Refresh |
37 | ShowClass |
38 | Timing |
39 | Turtles |
40 | /; |
41 | |
d6d18343 |
42 | # one $repl is shared: |
43 | # "Looks like the problem is that you can't open multiple instances of |
6bba7e87 |
44 | # Term::ReadLine:Perl from the same object. I was able to correct this by |
d6d18343 |
45 | # changing the test to reuse the same Devel::REPL instance each time. This |
46 | # prevents the warning that causes the test to fail. I don't think this |
47 | # changes the spirit of the test, it's just a byproduct of how |
48 | # Term::ReadLine::Perl works." -- RT#84246 |
49 | my $repl = Devel::REPL->new; |
1680cce5 |
50 | for my $plugin_name (@plugins) { |
51 | test_load_plugin($plugin_name); |
52 | } |
53 | |
54 | sub test_load_plugin { |
55 | my ($plugin_name) = @_; |
1680cce5 |
56 | my $test_name = "plugin $plugin_name loaded"; |
59500b7e |
57 | |
58 | SKIP: { |
59 | eval "use Devel::REPL::Plugin::$plugin_name; 1" |
60 | or skip "could not eval plugin $plugin_name", 1; |
61 | |
62 | ok(eval { $repl->load_plugin($plugin_name); 1 }, $test_name); |
1680cce5 |
63 | } |
64 | } |
65 | |
3e2f4695 |
66 | done_testing; |