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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# $Id$
package require tcltest
package require tclrivetparser
load [file join [pwd] .. src .libs librivetparser[info sharedlibext]]
::tcltest::test parserivetdata-1.1 {parserivetdata command} {
set fl [open hello.rvt]
set data [rivet::parserivetdata [read $fl]]
close $fl
set data
} {puts -nonewline ""
# hello-1.1
puts "Hello, World\n"
# i18n-1.1
puts " - El Burro Sabe Ms Que T!\n"
puts -nonewline "
<p>ܸ(EUC-JP Japanese text)</p>
"
}
::tcltest::test parserivet-1.1 {parserivet command} {
rivet::parserivet hello.rvt
} {namespace eval request {
puts -nonewline ""
# hello-1.1
puts "Hello, World\n"
# i18n-1.1
puts " - El Burro Sabe Ms Que T!\n"
puts -nonewline "
<p>ܸ(EUC-JP Japanese text)</p>
"
}
}
# Make sure that the Tcl version is identical to the C version.
::tcltest::test tclrivetparser-1.1 {tclparsedata command} {
set fl [open hello.rvt]
set data1 [tclrivetparser::parserivetdata [read $fl]]
close $fl
set fl [open hello.rvt]
set data2 [rivet::parserivetdata [read $fl]]
close $fl
set data2
string compare $data1 $data2
} {0}
|