<commit_before># Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

#use Test::More ( skip_all => "Skipped until better tests are written." );

#use Test::More ( tests => 15 );
use Test::More;
BEGIN { use_ok( 'UI::Dialog::Backend::Zenity' ); }
require_ok( 'UI::Dialog::Backend::Zenity' );

# #########################

my $obj = new UI::Dialog::Backend::Zenity
  ( test_mode => 1 );
isa_ok( $obj, 'UI::Dialog::Backend::Zenity' );

my $bin = $obj->get_bin();

my @methods = qw( new state ra rs rv nautilus xosd beep clear
                  yesno msgbox inputbox password textbox menu
                  checklist radiolist fselect dselect );
can_ok( 'UI::Dialog::Backend::Zenity', @methods );

$obj->yesno( title=>"TITLE", text => "TEXT",
             width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --question --text "TEXT"'
  );

$obj->msgbox( title=>"TITLE", text => "TEXT",
              width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --info --text "TEXT"'
  );

$obj->infobox( title=>"TITLE", text => "TEXT",
               width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --info --text "TEXT"'
  );

$obj->inputbox( title=>"TITLE", text => "TEXT",
                width => 64, height => 16, entry => "ENTRY" );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --entry --entry-text "ENTRY" --text "TEXT"'
  );

$obj->password( title=>"TITLE", text => "TEXT",
                width => 64, height => 16, entry => "ENTRY" );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --entry --hide-text --entry-text "ENTRY" --text "TEXT"'
  );

$obj->textbox( title=>"TITLE", path => "$0",
               width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --text-info --filename "t/UI-Dialog-Backend-Zenity.t"'
  );

$obj->menu( title=>"TITLE", text => "TEXT",
            width => 64, height => 16,
            list => [ "tag0", "item0", "tag1", "item1" ] );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --list --separator $'."'\\n'".' --column " " --column " " "tag0" "item0" "tag1" "item1"'
  );

$obj->checklist( title=>"TITLE", text => "TEXT",
                 width => 64, height => 16,
                 list => [ "tag0", [ "item0", 0 ], "tag1", [ "item1", 1 ] ] );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --list --checklist --separator $'."'\\n'".' --column " " --column " " --column " " "FALSE" "tag0" "item0" "TRUE" "tag1" "item1"'
  );<commit_msg>fix for hard coded test file name<commit_after># Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

#use Test::More ( skip_all => "Skipped until better tests are written." );

#use Test::More ( tests => 15 );
use Test::More;
BEGIN { use_ok( 'UI::Dialog::Backend::Zenity' ); }
require_ok( 'UI::Dialog::Backend::Zenity' );

# #########################

my $obj = new UI::Dialog::Backend::Zenity
  ( test_mode => 1 );
isa_ok( $obj, 'UI::Dialog::Backend::Zenity' );

my $bin = $obj->get_bin();

my @methods = qw( new state ra rs rv nautilus xosd beep clear
                  yesno msgbox inputbox password textbox menu
                  checklist radiolist fselect dselect );
can_ok( 'UI::Dialog::Backend::Zenity', @methods );

$obj->yesno( title=>"TITLE", text => "TEXT",
             width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --question --text "TEXT"'
  );

$obj->msgbox( title=>"TITLE", text => "TEXT",
              width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --info --text "TEXT"'
  );

$obj->infobox( title=>"TITLE", text => "TEXT",
               width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --info --text "TEXT"'
  );

$obj->inputbox( title=>"TITLE", text => "TEXT",
                width => 64, height => 16, entry => "ENTRY" );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --entry --entry-text "ENTRY" --text "TEXT"'
  );

$obj->password( title=>"TITLE", text => "TEXT",
                width => 64, height => 16, entry => "ENTRY" );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --entry --hide-text --entry-text "ENTRY" --text "TEXT"'
  );

$obj->textbox( title=>"TITLE", path => "$0",
               width => 64, height => 16 );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --text-info --filename "'.$0.'"'
  );

$obj->menu( title=>"TITLE", text => "TEXT",
            width => 64, height => 16,
            list => [ "tag0", "item0", "tag1", "item1" ] );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --list --separator $'."'\\n'".' --column " " --column " " "tag0" "item0" "tag1" "item1"'
  );

$obj->checklist( title=>"TITLE", text => "TEXT",
                 width => 64, height => 16,
                 list => [ "tag0", [ "item0", 0 ], "tag1", [ "item1", 1 ] ] );
is( $obj->get_unit_test_result(),
    $bin.' --title "TITLE" --width "64" --height "16" --list --checklist --separator $'."'\\n'".' --column " " --column " " --column " " "FALSE" "tag0" "item0" "TRUE" "tag1" "item1"'
  );
{'fraction_non_alphanumeric': 0.2426495437647854, 'fraction_numerical': 0.029908752957080096, 'mean_word_length': 2.87369109947644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3839814', 'n_tokens_mistral': 2247, 'n_tokens_neox': 2078, 'n_words': 572}