File: binary.test

package info (click to toggle)
libapache2-mod-rivet 2.2.0-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,884 kB
  • ctags: 1,016
  • sloc: sh: 12,406; xml: 6,972; tcl: 6,149; ansic: 5,515; makefile: 200; sql: 91; lisp: 78
file content (26 lines) | stat: -rw-r--r-- 788 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
21
22
23
24
25
26
# $Id: binary.test 1212149 2011-12-08 21:57:35Z mxmanghi $

set testfilename1 binary.rvt
set binaryfile AngeloFish.jpg

::tcltest::test binary-1.1 {binary data test} {
    set page [ ::http::geturl "${urlbase}$testfilename1?test1=1" ]
    set fl [open $binaryfile r]
    fconfigure $fl -translation binary
    fconfigure $fl -encoding binary
    set ret [string equal -length 42747 [::http::data $page] [read $fl]]
    close $fl
    set ret
} 1

::tcltest::test binary-2.1 {binary data test with 'include'} {
    set page [ ::http::geturl "${urlbase}$testfilename1?test2=1" ]
    set fl [open $binaryfile r]
    fconfigure $fl -translation binary
    fconfigure $fl -encoding binary
    set ret [string equal -length 42747 [::http::data $page] [read $fl]]
    close $fl
    set ret
} 1