_acs-templating__validate_file (private)

 _acs-templating__validate_file

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

Partial Call Graph (max 5 caller/called nodes):
%3 aa_log aa_log (public) aa_log_result aa_log_result (public) aa_silence_log_entries aa_silence_log_entries (public) ad_file ad_file (public) ad_opentmpfile ad_opentmpfile (public) _acs-templating__validate_file _acs-templating__validate_file _acs-templating__validate_file->aa_log _acs-templating__validate_file->aa_log_result _acs-templating__validate_file->aa_silence_log_entries _acs-templating__validate_file->ad_file _acs-templating__validate_file->ad_opentmpfile

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    #
    # A valid, existing tmpfile
    #
    set wfd [ad_opentmpfile tmpfile]
    puts $wfd 1234
    close $wfd

    #
    # A tmpfile that does not exist
    #
    set tmpfile_missing [ad_tmpnam]

    set values [list  my_file false  lalala false  [list Afile $tmpfile text/plain] true  [list A/file $tmpfile ""] false  [list A/file $tmpfile a] true  [list A/file $tmpfile_missing a] false  [list \\afile $tmpfile a] false  {afile /etc/passwd text/css} false  ]

    set message ""
    foreach {value expected} $values {
        aa_silence_log_entries -severities [expr {$expected eq "false" ? "warning" : ""}] {
            aa_$expected "Is $value a file?"  [template::data::validate file value message]
        }
    }
    ad_file delete $tmpfile
}} {
          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" "validate_file (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: