prop_extractOpSummary :: MetaOpCode -> Int -> Property
prop_extractOpSummary meta i =
  conjoin [ counterexample "valid opcode" $
            extractOpSummary (ValidOpCode meta)      ==? summary
          , counterexample "invalid opcode, correct object" $
            extractOpSummary (InvalidOpCode jsobj)   ==? summary
          , counterexample "invalid opcode, empty object" $
            extractOpSummary (InvalidOpCode emptyo)  ==? invalid
          , counterexample "invalid opcode, object with invalid OP_ID" $
            extractOpSummary (InvalidOpCode invobj)  ==? invalid
          , counterexample "invalid opcode, not jsobject" $
            extractOpSummary (InvalidOpCode jsinval) ==? invalid
          ]
    where summary = opSummary (metaOpCode meta)
          jsobj = showJSON $ toJSObject [("OP_ID",
                                          showJSON ("OP_" ++ summary))]
          emptyo = showJSON $ toJSObject ([]::[(String, JSValue)])
          invobj = showJSON $ toJSObject [("OP_ID", showJSON False)]
          jsinval = showJSON i
          invalid = "INVALID_OP"
prop_extractOpSummary :: MetaOpCode -> Int -> Property
prop_extractOpSummary meta i =
  conjoin [ counterexample "valid opcode" $
            extractOpSummary (ValidOpCode meta)      ==? summary
          , counterexample "invalid opcode, correct object" $
            extractOpSummary (InvalidOpCode jsobj)   ==? summary
          , counterexample "invalid opcode, empty object" $
            extractOpSummary (InvalidOpCode emptyo)  ==? invalid
          , counterexample "invalid opcode, object with invalid OP_ID" $
            extractOpSummary (InvalidOpCode invobj)  ==? invalid
          , counterexample "invalid opcode, not jsobject" $
            extractOpSummary (InvalidOpCode jsinval) ==? invalid
          ]
    where summary = opSummary (metaOpCode meta)
          jsobj = showJSON $ toJSObject [("OP_ID",
                                          showJSON ("OP_" ++ summary))]
          emptyo = showJSON $ toJSObject ([]::[(String, JSValue)])
          invobj = showJSON $ toJSObject [("OP_ID", showJSON False)]
          jsinval = showJSON i
          invalid = "INVALID_OP"
prop_extractOpSummary meta i =
  conjoin [ counterexample "valid opcode" $
            extractOpSummary (ValidOpCode meta)      ==? summary
          , counterexample "invalid opcode, correct object" $
            extractOpSummary (InvalidOpCode jsobj)   ==? summary
          , counterexample "invalid opcode, empty object" $
            extractOpSummary (InvalidOpCode emptyo)  ==? invalid
          , counterexample "invalid opcode, object with invalid OP_ID" $
            extractOpSummary (InvalidOpCode invobj)  ==? invalid
          , counterexample "invalid opcode, not jsobject" $
            extractOpSummary (InvalidOpCode jsinval) ==? invalid
          ]
    where summary = opSummary (metaOpCode meta)
          jsobj = showJSON $ toJSObject [("OP_ID",
                                          showJSON ("OP_" ++ summary))]
          emptyo = showJSON $ toJSObject ([]::[(String, JSValue)])
          invobj = showJSON $ toJSObject [("OP_ID", showJSON False)]
          jsinval = showJSON i
          invalid = "INVALID_OP"