Module: ncgi
modules/ncgi/ncgi.test
==== ncgi-14.3 ncgi::multipart FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::multipart $type $X
---- Result was:
{} {{} {Content-Disposition: form-data; name="field1"
value
}} {} {{} {Content-Disposition: form-data; name="field2"
another value
}} {} {{} {Content-Disposition: form-data; name="the_file_naame"; filename="C:\Program Files\Netscape\Communicator\Program\nareadme.htm"
Content-Type: text/html
Netscape Address Book Sync for Palm Pilot
User Guide
}}
---- Result should have been (exact matching):
field1 {{content-disposition form-data name field1} value} field2 {{content-disposition form-data name field2} {another value}} the_file_naame {{content-disposition form-data name the_file_naame filename {C:\Program Files\Netscape\Communicator\Program\nareadme.htm} content-type text/html} {
Netscape Address Book Sync for Palm Pilot
User Guide
}}
==== ncgi-14.3 FAILED
==== ncgi-14.4 ncgi::multipart FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
list [ncgi::value field1] [ncgi::value field2] [ncgi::value the_file_naame]
---- Result was:
{} {} {}
---- Result should have been (exact matching):
value {another value} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.4 FAILED
==== ncgi-14.5 ncgi::multipart--check binary file FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
# Read the file in as though it were binary.
fconfigure $in -translation binary
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
set content [ncgi::value the_file_naame]
list [ncgi::value field1] [ncgi::value field2] $content
---- Result was:
{} {} {}
---- Result should have been (exact matching):
value {another value} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.5 FAILED
==== ncgi-14.6 ncgi::multipart setValue FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
ncgi::setValue userval1 foo
ncgi::setValue userval2 "a b"
list [ncgi::value field1] [ncgi::value field2] [ncgi::value userval1] [ncgi::value userval2] [ncgi::value the_file_naame]
---- Result was:
{} {} foo {a b} {}
---- Result should have been (exact matching):
value {another value} foo {a b} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.6 FAILED
env array elements created: HTTPS SERVER_PORT SERVER_NAME REQUEST_URI REQUEST_METHOD CONTENT_TYPE CONTENT_LENGTH
Module: ncgi
modules/ncgi/ncgi.test
==== ncgi-14.3 ncgi::multipart FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::multipart $type $X
---- Result was:
{} {{} {Content-Disposition: form-data; name="field1"
value
}} {} {{} {Content-Disposition: form-data; name="field2"
another value
}} {} {{} {Content-Disposition: form-data; name="the_file_naame"; filename="C:\Program Files\Netscape\Communicator\Program\nareadme.htm"
Content-Type: text/html
Netscape Address Book Sync for Palm Pilot
User Guide
}}
---- Result should have been (exact matching):
field1 {{content-disposition form-data name field1} value} field2 {{content-disposition form-data name field2} {another value}} the_file_naame {{content-disposition form-data name the_file_naame filename {C:\Program Files\Netscape\Communicator\Program\nareadme.htm} content-type text/html} {
Netscape Address Book Sync for Palm Pilot
User Guide
}}
==== ncgi-14.3 FAILED
==== ncgi-14.4 ncgi::multipart FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
list [ncgi::value field1] [ncgi::value field2] [ncgi::value the_file_naame]
---- Result was:
{} {} {}
---- Result should have been (exact matching):
value {another value} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.4 FAILED
==== ncgi-14.5 ncgi::multipart--check binary file FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
# Read the file in as though it were binary.
fconfigure $in -translation binary
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
set content [ncgi::value the_file_naame]
list [ncgi::value field1] [ncgi::value field2] $content
---- Result was:
{} {} {}
---- Result should have been (exact matching):
value {another value} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.5 FAILED
==== ncgi-14.6 ncgi::multipart setValue FAILED
==== Contents of test case:
set in [open [file join [file dirname [info script]] formdata.txt]]
set X [read $in]
close $in
foreach line [split $X \n] {
if {[string length $line] == 0} {
break
}
if {[regexp {^Content-Type: (.*)$} $line x type]} {
break
}
}
regsub ".*?\n\n" $X {} X
ncgi::reset $X $type
ncgi::parse
ncgi::setValue userval1 foo
ncgi::setValue userval2 "a b"
list [ncgi::value field1] [ncgi::value field2] [ncgi::value userval1] [ncgi::value userval2] [ncgi::value the_file_naame]
---- Result was:
{} {} foo {a b} {}
---- Result should have been (exact matching):
value {another value} foo {a b} {
Netscape Address Book Sync for Palm Pilot
User Guide
}
==== ncgi-14.6 FAILED
env array elements created: HTTPS SERVER_PORT SERVER_NAME REQUEST_URI REQUEST_METHOD CONTENT_TYPE CONTENT_LENGTH