_acs-tcl__ad_string_truncate (private)

 _acs-tcl__ad_string_truncate

Defined in packages/acs-tcl/tcl/test/html-conversion-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) ad_string_truncate ad_string_truncate (public) _acs-tcl__ad_string_truncate _acs-tcl__ad_string_truncate _acs-tcl__ad_string_truncate->aa_equals _acs-tcl__ad_string_truncate->aa_log _acs-tcl__ad_string_truncate->aa_log_result _acs-tcl__ad_string_truncate->ad_string_truncate

Testcases:
No testcase defined.
Source code:
        
        set _aa_export {}
        set body_count 1
        foreach testcase_body {{
    aa_equals "" [ad_string_truncate -len  5 -ellipsis "" -- "foo""foo"
    aa_equals "" [ad_string_truncate -len  5 -ellipsis "" -- "foobar greble""fooba"
    aa_equals "" [ad_string_truncate -len  6 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "" -- "foobar\tgreble""foobar"
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "" -- "foobar\ngreble""foobar"
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "" -- "foobar\rgreble""foobar"
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "" -- "foobar\fgreble""foobar"
    aa_equals "" [ad_string_truncate -len  8 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len  9 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len 10 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len 11 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len 12 -ellipsis "" -- "foobar greble""foobar"
    aa_equals "" [ad_string_truncate -len 13 -ellipsis "" -- "foobar greble""foobar greble"

    aa_equals "" [ad_string_truncate -len  5 -ellipsis "..." -- "foo""foo"
    aa_equals "" [ad_string_truncate -len  5 -ellipsis "..." -- "foobar greble""fo..."
    aa_equals "" [ad_string_truncate -len  6 -ellipsis "..." -- "foobar greble""foo..."
    aa_equals "" [ad_string_truncate -len  7 -ellipsis "..." -- "foobar greble""foob..."
    aa_equals "" [ad_string_truncate -len  8 -ellipsis "..." -- "foobar greble""fooba..."
    aa_equals "" [ad_string_truncate -len  9 -ellipsis "..." -- "foobar greble""foobar..."
    aa_equals "" [ad_string_truncate -len 10 -ellipsis "..." -- "foobar greble""foobar..."
    aa_equals "" [ad_string_truncate -len 11 -ellipsis "..." -- "foobar greble""foobar..."
    aa_equals "" [ad_string_truncate -len 12 -ellipsis "..." -- "foobar greble""foobar..."
    aa_equals "" [ad_string_truncate -len 13 -ellipsis "..." -- "foobar greble""foobar greble"

    set long_string [string repeat "Very long text. " 100]
    aa_equals "No truncation" [ad_string_truncate -len [string length $long_string] -- $long_string$long_string
}} {
          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_string_truncate (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: