_acs-tcl__ad_page_contract_argspec_parsing (private)

 _acs-tcl__ad_page_contract_argspec_parsing

Defined in packages/acs-tcl/tcl/test/tcl-documentation-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-tcl__ad_page_contract_argspec_parsing _acs-tcl__ad_page_contract_argspec_parsing _acs-tcl__ad_page_contract_argspec_parsing->aa_equals _acs-tcl__ad_page_contract_argspec_parsing->aa_log _acs-tcl__ad_page_contract_argspec_parsing->aa_log_result _acs-tcl__ad_page_contract_argspec_parsing->aa_section _acs-tcl__ad_page_contract_argspec_parsing->aa_true

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
        aa_section "Valid specs"
        foreach {spec expected_name expected_flags} {
            w:oneof(red|green)
            w
            oneof(red|green)

            my_page_parameter
            my_page_parameter
            ""

            my_page_parameter:integer
            my_page_parameter
            integer

            my_page_parameter:integer,notnull
            my_page_parameter
            integer,notnull

            my_page_parameter:integer,notnull,oneof(1|2|3)
            my_page_parameter
            integer,notnull,oneof(1|2|3)

            {another_page_parameter:oneof(this is valid|This, is also valid|This is valid \(as well!\))}
            another_page_parameter
            {oneof(this is valid|This, is also valid|This is valid \(as well!\))}

            {another_page_parameter:oneof(this is \|valid|This, is also valid|This is valid \(as well!\))}
            another_page_parameter
            {oneof(this is \|valid|This, is also valid|This is valid \(as well!\))}

        } {
            set r [ad_page_contract_parse_argspec $spec]
            aa_equals "name for spec '$spec' OK" $expected_name [lindex $r 0]
            aa_equals "flags for spec '$spec' OK" $expected_flags [lindex $r 1]
        }

        aa_section "Invalid specs"
        foreach spec {
            w::a

            w::

            w:oneof(red|green))

            w:notnull,,integer

            "my_page_parameter)"

            "my_page_parameter:(integer"
        } {
            aa_true "spec '$spec' KO" [catch {
                [ad_page_contract_parse_argspec $spec]
            } errmsg]
        }

        aa_section "Spec flags"
        foreach {flags flags_list} {
            oneof(red|green)
            oneof(red|green)

            ""
            ""

            integer
            integer

            integer,notnull
            {integer notnull}

            integer,notnull,oneof(1|2|3)
            {integer notnull oneof(1|2|3)}

            {oneof(this is valid|This, is also valid|This is valid \(as well!\))}
            {{oneof(this is valid|This, is also valid|This is valid \(as well!\))}}

            {optional,notnull,oneof(this is valid|This, is also valid|This is valid \(as well!\))}
            {optional notnull {oneof(this is valid|This, is also valid|This is valid \(as well!\))}}

            {optional,notnull,oneof(this is \|valid|This, is also valid|This is valid \(as well!\))}
            {optional notnull {oneof(this is \|valid|This, is also valid|This is valid \(as well!\))}}
        } {
            set r [ad_page_contract_split_argspec_flags $flags]
            aa_equals "Parsing flags '$flags' OK" $flags_list $r
        }

        aa_section "Spec flag parameters"
        foreach {flag_parameters flag_parameters_list} {
            red|green
            {red green}

            ""
            ""

            {this is valid|This, is also valid|This is valid \(as well!\)}
            {{this is valid} {This, is also valid} {This is valid (as well!)}}

            {part1\|part2|another \(value\)|normievalue}
            {part1|part2 {another (value)} normievalue}
        } {
            set r [ad_page_contract_split_argspec_flag_parameters $flag_parameters]
            aa_equals "Splitting flag parameters '$flag_parameters' OK" $flag_parameters_list $r
        }
    }} {
          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" "ad_page_contract_argspec_parsing (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: