tree-features: f7995f36740545727e7200653825d56dda55c2af

     1: module XmlTest (tests, testData) where
     2: 
     3: import Test.Tasty (testGroup)
     4: import Test.Tasty.QuickCheck (testProperty)
     5: import Test.QuickCheck
     6: import Text.XML.Light.Input
     7: import Text.XML.Light.Types
     8: import Features
     9: import XmlHelper
    10: 
    11: testData = "<REQUEST req=\"\">\
    12:             \  <APPLY id=\"i0\" sort=\"Type\">\
    13:             \    <MUTIND uri=\"cic:/Coq/Init/Logic/eq.ind\" noType=\"0\" id=\"i67\"/>\
    14:             \    <MUTIND uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" id=\"i64\"/>\
    15:             \    <APPLY id=\"i38\" sort=\"Set\">\
    16:             \      <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i60\" sort=\"Set\"/>\
    17:             \      <APPLY id=\"i40\" sort=\"Set\">\
    18:             \        <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i56\" sort=\"Set\"/>\
    19:             \        <APPLY id=\"i42\" sort=\"Set\">\
    20:             \          <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i52\" sort=\"Set\"/>\
    21:             \          <APPLY id=\"i44\" sort=\"Set\">\
    22:             \            <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i48\" sort=\"Set\"/>\
    23:             \            <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"1\" id=\"i46\" sort=\"Set\"/>\
    24:             \          </APPLY>\
    25:             \        </APPLY>\
    26:             \      </APPLY>\
    27:             \    </APPLY>\
    28:             \    <APPLY id=\"i2\" sort=\"Set\">\
    29:             \      <CONST uri=\"cic:/Coq/Init/Peano/plus.con\" id=\"i32\" sort=\"Set\"/>\
    30:             \      <APPLY id=\"i12\" sort=\"Set\">\
    31:             \        <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i28\" sort=\"Set\"/>\
    32:             \        <APPLY id=\"i14\" sort=\"Set\">\
    33:             \          <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i24\" sort=\"Set\"/>\
    34:             \          <APPLY id=\"i16\" sort=\"Set\">\
    35:             \            <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i20\" sort=\"Set\"/>\
    36:             \            <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"1\" id=\"i18\" sort=\"Set\"/>\
    37:             \          </APPLY>\
    38:             \        </APPLY>\
    39:             \      </APPLY>\
    40:             \      <APPLY id=\"i4\" sort=\"Set\">\
    41:             \        <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"2\" id=\"i8\" sort=\"Set\"/>\
    42:             \        <MUTCONSTRUCT uri=\"cic:/Coq/Init/Datatypes/nat.ind\" noType=\"0\" noConstr=\"1\" id=\"i6\" sort=\"Set\"/>\
    43:             \      </APPLY>\
    44:             \    </APPLY>\
    45:             \  </APPLY>\
    46:             \  <APPLY id=\"i0\" sort=\"Type\">\
    47:             \    <MUTIND uri=\"cic:/Coq/Init/Datatypes/list.ind\" noType=\"0\" id=\"i5\"/>\
    48:             \    <MUTIND uri=\"cic:/Coq/Init/Datatypes/bool.ind\" noType=\"0\" id=\"i2\"/>\
    49:             \  </APPLY>\
    50:             \</REQUEST>"
    51: 
    52: parseTest = case parseXMLDoc testData of
    53:                  Nothing -> False
    54:                  Just _  -> True
    55: 
    56: parseTrees xml = let x = parseRequest xml in True
    57: 
    58: tests = testGroup "XML Tests"
    59:           [
    60:             testProperty "Can parse example"         parseTest
    61:           , testProperty "Can parse example to tree" parseTrees
    62:           ]

Generated by git2html.