code.sa
Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
class TEST_CODE
class TEST_CODE is
-- This is a test program to test the cultural character repertoire
-- class. Note that it is not portable for simplicity in building a local
-- library.
-- Version 1.0 Oct 97. Copyright K Hopper, U of Waikato
-- Development History
-- -------------------
-- Date Who By Detail
-- ---- ------ ------
-- 15 Oct 97 kh Original
include TEST ;
main is
class_name("CODE") ;
lib : LIBCHARS := LIBCHARS::default ;
item : CHAR_CODE := CHAR_CODE::create('M',lib) ;
loc_bin : BINSTR := item.binstr ;
bin_item : CHAR_CODE := CHAR_CODE::build(loc_bin.cursor) ;
test("create",item.binstr.text_str,lib.culture.kind.card.hex_str(lib,2) +
" " + 'M'.code.hex_str(lib,2)) ;
test("is_eq",(item = bin_item).str, true.str) ;
test("is_lt",(item < bin_item).str, false.str) ;
test("hex_str",bin_item.hex_str,'M'.code.hex_str) ;
loc_str : STR := STR::create ;
loop
loc_str := loc_str + item.octet!.str
end ;
test("octet!",loc_str.size.str,((2 + 2) * item.lib.my_size).str) ;
-- The characters '0x' plus two per octet!
loc_str := STR::create(lib) ;
loop
loc_str := loc_str + bin_item.octet!.char
end ;
test("elt!",loc_str,"M") ;
finish
end ;
end ; -- TEST_CODE