### ----------------------------------------------------
### -- Menu::Simple
### -- Licenses: Artistic-2.0
### -- Authors: Steve Dondley
### -- File: t/xt/01-strip-leading-numbers.rakutest
### ----------------------------------------------------
#!/usr/bin/env raku
use v6.d;
use lib '.';
use Test;
use Test::Output;
use Menu::HashToMenu;

when !%*ENV<AUTHOR_TESTING> { skip 'Skipping author tests'; done-testing; }

plan 2;

my %hash = '01 - option' => 'hello';

my $menu = HashToMenu.new(%hash);
$menu.menu[0].display;
output-like { $menu.execute }, /'01 - option' \n .*/, 'keeps option sort number';

my $menu2 = HashToMenu.new(%hash, :strip-sort-number);
$menu2.menu[0].display;
output-like { $menu2.execute }, /'option' \n .*/, 'strips option sort number';



done-testing;


