_xowiki__dict_to_xx (private)

 _xowiki__dict_to_xx

Defined in packages/xowiki/tcl/test/api-test-procs.tcl

Partial Call Graph (max 5 caller/called nodes):
%3 _ _ (public) aa_equals aa_equals (public) aa_log aa_log (public) aa_log_result aa_log_result (public) xowiki::formfield::dict_to_spec xowiki::formfield::dict_to_spec (public) _xowiki__dict_to_xx _xowiki__dict_to_xx _xowiki__dict_to_xx->_ _xowiki__dict_to_xx->aa_equals _xowiki__dict_to_xx->aa_log _xowiki__dict_to_xx->aa_log_result _xowiki__dict_to_xx->xowiki::formfield::dict_to_spec

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        set dict {_name myname _type text label "Hello, world!" enabled 1}

        aa_equals "convert to spec"  [::xowiki::formfield::dict_to_spec $dict]  {myname:text,label=Hello__COMMA__ world!,enabled=1}
        aa_equals "convert to spec -aspair"  [::xowiki::formfield::dict_to_spec -aspair $dict]  {myname {text,label=Hello__COMMA__ world!,enabled=1}}

        #
        # Common idiom constructing form constraints
        #
        set fc ""lappend fc  @categories:off @cr_fields:hidden  [::xowiki::formfield::dict_to_spec $dict]

        aa_equals "lappend + dict_to_spec fc idiom"  [concat $fc]  {@categories:off @cr_fields:hidden {myname:text,label=Hello__COMMA__ world!,enabled=1}}

        #
        # Common idiom to create component structure
        #

        set struct [subst {
            [list [::xowiki::formfield::dict_to_spec -aspair $dict]]
            {pattern {text,default=*,label=pool_question_pattern}}
        }]
        aa_equals "lappend + dict_to_spec component structure idiom"  [concat $struct]  {{myname {text,label=Hello__COMMA__ world!,enabled=1}}
            {pattern {text,default=*,label=pool_question_pattern}}}

        #
        # fc_to_dct
        #
        set fc ""lappend fc  @categories:off @cr_fields:hidden  [::xowiki::formfield::dict_to_spec $dict]

        aa_equals "fc_to_dict (show results of reverse operation)"  [::xowiki::formfield::fc_to_dict $fc]  {myname {_name myname _type text label {Hello, world!} enabled 1 _definition {text,label=Hello__COMMA__ world!,enabled=1}}}

        #
        # dict_value
        #
        aa_equals "dict_value exists"  [::xowiki::formfield::dict_value $dict label]  {Hello, world!}
        aa_equals "dict_value not exists, no default"  [::xowiki::formfield::dict_value $dict title]  {}
        aa_equals "dict_value not exists, default"  [::xowiki::formfield::dict_value $dict title xxx]  {xxx}
    }} {
          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" "dict_to_xx (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: