File: curses_ui.t

package info (click to toggle)
libconfig-model-cursesui-perl 1.107-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 148 kB
  • sloc: perl: 1,673; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- cperl -*-

use ExtUtils::testlib;
use Test::More ;
use Config::Model ;
use Config::Model::Tester::Setup qw/init_test/;
use Config::Model::CursesUI ;
use Curses::UI ;

use strict ;
use warnings;
use lib 't/lib';

my ($model, $trace, $args) = init_test('interactive');

note("You can run the GUI with 'i' argument. E.g. 'perl t/curses_ui.t i'");

my $inst = $model->instance (
    root_class_name => 'Master',
    instance_name   => 'test1'
);
ok($inst,"created dummy instance") ;

# re-direct errors
open (FH,">>stderr.log") || die $! ;
open STDERR, ">&FH";

warn "----\n";

$inst->config_root->load("hash_a:foo=bar") ;

if ($args->{interactive} ) {
    my $dialog = Config::Model::CursesUI-> new (
        permission => 'advanced',
        debug => 1,
    ) ;
    $dialog->start( $model )  ;
}

close FH ;

ok(1,"done") ;

done_testing;