File: headers.test

package info (click to toggle)
libapache2-mod-rivet 3.2.2-1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 6,296 kB
  • sloc: xml: 8,554; tcl: 7,568; ansic: 7,094; sh: 5,017; makefile: 195; sql: 91; lisp: 78
file content (20 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -- headers.test
#
# testing ::rivet::load_headers command
#

set testfilename1 headers.rvt

# We do this in order to always match the version present.
set httpversion [package require http]
set result "hdrs(Accept)     = */*
hdrs(Host)       = localhost:8081
hdrs(User-Agent) = Tcl http client package $httpversion"

::tcltest::test headers-1.1 {load_headers test} {
    set page [::http::geturl "${urlbase}$testfilename1"]
    regexp -all -lineanchor "(^hdrs.*?$\n){3}" [::http::data $page] match
    set match [string trim $match]
    ::http::cleanup $page
    set match
} $result