test/Tools/isac/xmlsrc/mathml.sml
author Walther Neuper <neuper@ist.tugraz.at>
Tue, 28 Sep 2010 09:06:56 +0200
branchisac-update-Isa09-2
changeset 38031 460c24a6a6ba
parent 37906 e2b23ba9df13
child 42176 3573fd729e99
permissions -rw-r--r--
tuned error and writeln

# raise error --> error
# writeln in atomtyp, atomty, atomt and xmlsrc
     1 (* tests for mathml.sml
     2    author: Walther Neuper 060311
     3    (c) isac-team 2006
     4 
     5 use"../smltest/xmlsrc/mathml.sml";
     6 use"mathml.sml";
     7 *)
     8 "-----------------------------------------------------------------";
     9 "table of contents -----------------------------------------------";
    10 "-----------------------------------------------------------------";
    11 "within struct ---------------------------------------------------";
    12 "-----------------------------------------------------------------";
    13 "--------- encode ^^^ -> ^ ---------------------------------------";
    14 "--------- encode < -> &lt and > -> &gt --------------------------";
    15 "-----------------------------------------------------------------";
    16 "exported from struct --------------------------------------------";
    17 "-----------------------------------------------------------------";
    18 "--------- ... ---------------------------------------------------";
    19 "-----------------------------------------------------------------";
    20 
    21 
    22 
    23 "-----------------------------------------------------------------";
    24 "within struct ---------------------------------------------------";
    25 "-----------------------------------------------------------------";
    26 (*==================================================================*)
    27 
    28 
    29 "--------- encode ^^^ -> ^ ---------------------------------------";
    30 "--------- encode ^^^ -> ^ ---------------------------------------";
    31 "--------- encode ^^^ -> ^ ---------------------------------------";
    32 val str = "a^^^2+b^^^2=c^^^2";
    33 if decode str = "a^2+b^2=c^2" then ()
    34 else error "mathml.sml: diff.behav. in encode ^^^ -> ^";
    35 
    36 "--------- encode < -> &lt and > -> &gt --------------------------";
    37 "--------- encode < -> &lt and > -> &gt --------------------------";
    38 "--------- encode < -> &lt and > -> &gt --------------------------";
    39 val str = "?bdv occurs_in ?b; 0 < ?n |] ==> ?a / ?b ^ ?n = ?a * ?b ^ - ?n";
    40 if decode str = 
    41    "?bdv occurs_in ?b; 0 &lt ?n |] ==&gt ?a / ?b ^ ?n = ?a * ?b ^ - ?n" 
    42 then () else error "mathml.sml: diff.behav. in encode '<' and '>'";
    43 
    44 "----- check 'manually' the xml-output of calling functions ------";
    45 formula2xml 1 (str2term )
    46 
    47 (*==================================================================*)
    48 "-----------------------------------------------------------------";
    49 "exported from struct --------------------------------------------";
    50 "-----------------------------------------------------------------";
    51 
    52