_acs-templating__lists_and_multirows (private)

 _acs-templating__lists_and_multirows

Defined in packages/acs-templating/tcl/test/util-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) aa_section aa_section (public) aa_true aa_true (public) _acs-templating__lists_and_multirows _acs-templating__lists_and_multirows _acs-templating__lists_and_multirows->aa_equals _acs-templating__lists_and_multirows->aa_log _acs-templating__lists_and_multirows->aa_log_result _acs-templating__lists_and_multirows->aa_section _acs-templating__lists_and_multirows->aa_true

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    set the_list {
        {one 1 two 2 three 3 four 4 five 5}
        {one 11 two 22 three 33 four 44 five 55}
        {one 111 two 222 three 333 four 444 five 555}
        {one 1111 two 2222 three 3333 four 4444 five 5555}
        {one 11111 two 22222 three 33333 four 44444 five 55555}
    }

    set expected_columns [lsort [list rownum {*}[dict keys [lindex $the_list 0]]]]

    set level \#[::template::adp_level]

    aa_section {List to Multirow}

    ::template::util::list_to_multirow the_multirow $the_list $level

    aa_true "Multirow exists" [template::multirow exists the_multirow]

    aa_equals "[llength $the_list] elements"  [template::multirow size the_multirow] [llength $the_list]

    aa_equals "Columns are correct"  [lsort [template::multirow columns the_multirow]] $expected_columns


    aa_section {Multirow to List}

    set the_second_list [::template::util::multirow_to_list -level $level the_multirow]

    set i 1
    foreach converted $the_second_list {
        aa_equals "Element $i has the expected dict format"  [lsort [dict keys $converted]] $expected_columns
        incr i
    }

    aa_equals "Converted list has the same size"  [llength $the_second_list] [llength $the_list]
}} {
          aa_log "Running testcase body $body_count"
          set ::__aa_test_indent [info level]
          set catch_val [catch $testcase_body msg]
          if {$catch_val != 0 && $catch_val != 2} {
              aa_log_result "fail" "lists_and_multirows (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo"
          }
          incr body_count
        }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: