From ae9e775295c68479ec1d96a5eca2095356447857 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Wed, 9 Apr 2025 15:08:16 +1000 Subject: [PATCH] added more shortif test cases for attributes. --- system/modules/MarkdownPlugin.pm | 9 ++++---- system/modules/PluginBase.pm | 2 +- tests/testCNFNodeShortiefs.pl | 38 ++++++++++++++++++++++++++++---- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/system/modules/MarkdownPlugin.pm b/system/modules/MarkdownPlugin.pm index f37c8e2..562c2a4 100644 --- a/system/modules/MarkdownPlugin.pm +++ b/system/modules/MarkdownPlugin.pm @@ -105,6 +105,7 @@ sub toHTML_headings($self,$hdrs) { my @headings = @$hdrs; my $bf; my $level = 0; + my $top = ' style="padding-top: 1rem"'; for my $i(0..$#headings){ my @spec = @{$headings[$i]}; my $cnt = $i+1; @@ -112,9 +113,9 @@ sub toHTML_headings($self,$hdrs) { my $lnk = "".$spec[0].""; if($lvl!=$level){ if($lvl>$level){ - $bf .= ""; } $level = $lvl; } @@ -801,9 +802,9 @@ div .cnf { padding: 2px; } .Q { - color: #b217ea; + color:#B217EA; font-weight: bold; -} +} .pa { color: rgb(52, 52, 130); font-weight: bold; diff --git a/system/modules/PluginBase.pm b/system/modules/PluginBase.pm index 00f1836..0a74e2a 100644 --- a/system/modules/PluginBase.pm +++ b/system/modules/PluginBase.pm @@ -1,7 +1,7 @@ package PluginBase; use v5.36; use strict; -use warnings; +use warnings; no warnings qw(experimental::signatures); use Syntax::Keyword::Try; use feature qw(signatures); use Scalar::Util qw(looks_like_number); diff --git a/tests/testCNFNodeShortiefs.pl b/tests/testCNFNodeShortiefs.pl index 0282310..a2cf49e 100644 --- a/tests/testCNFNodeShortiefs.pl +++ b/tests/testCNFNodeShortiefs.pl @@ -43,20 +43,50 @@ Giving no advice. ),$a_sub->val()); - my $parse_listed = CNFParser-> new() -> parse(undef,q(<< new(undef,{ANONS_ARE_PUBLIC=>0}) -> parse(undef,q(<<>>)); $test->isDefined("CNF sequential anon format 'listed' is it defined?",$parse_listed->anon('listed')); - $parse_listed = $parse_listed->anon('listed'); - $test->evaluate("CNF sequential anon format 'listed' has two itens?",2,scalar(@{$parse_listed->list()})); + my $prp_listed = $parse_listed->anon('listed'); + $test->evaluate("CNF sequential anon format 'listed' has two itens?",2,scalar(@{$prp_listed->list()})); + $test->subcase("Check CNF sequential anon format 'listed' values."); + my @listed = @{$prp_listed->list()}; + $test->evaluate("listed[0] == '123'", '1 2 3', $listed[0]->val()); + $test->evaluate("listed[0] == '2'", '2', $listed[1]->val()); + + $test->subcase("Test with attributes CNF sequential anon format 'listed'"); + my $parse_listed2 = CNFParser-> new(undef,{ANONS_ARE_PUBLIC=>0}) -> parse(undef,q(<<>>)); + my $prp_listed2 = $parse_listed2->anon('listed'); + @listed = @{$prp_listed2->list()}; + $test->evaluate("listed[0]:a == 'A'", 'A', $listed[0]->{'a'}); + $test->evaluate("listed[0]:b == 'B'", 'B', $listed[0]->{'b'}); + $test->evaluate("listed[2]:c == 'C'", 'C', $listed[2]->{'c'}); + $test->evaluate("listed[2] == '3'", '3', $listed[2]->val()); + + + $test -> case("Test process shortif directly with CNF sequential anon format.", '2'); -- 2.34.1