caldav::test::ical_stats (private)
caldav::test::ical_stats [ -require_crlf ] ical_text
Defined in packages/caldav/tcl/test/caldav-test-procs.tcl
Check the ical text for validity and return a dict with descriptive statistics.
- Switches:
- -require_crlf (optional, boolean, defaults to
"true"
)- Parameters:
- ical_text (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: #set F [open [ad_tmpdir]/dump.ics w]; puts -nonewline $F $resp; close $F array set count { lines 0 lines_without_crlf 0 overlong_lines 0 continuation_lines 0 nr_uids 0 uids {} } foreach line [split $ical_text \n] { incr count(lines) if {$require_crlf_p && [string index $line end] ne "\r"} { incr count(lines_without_crlf) #ns_log notice "line_without_crlf: $line" } if {[string index $line 0] eq " "} { incr count(continuation_lines) } if {[string length $line] > 76} { incr count(overlong_lines) ns_log warning "overlong_line (chars [string length $line]): <$line>" } if {[regexp {^UID:(.*)\r$} $line . uid]} { incr count(nr_uids) lappend count(uids) $uid } } return [array get count]XQL Not present: Generic, PostgreSQL, Oracle