anchor.diff:  get_value(Key, List, Default) ->
      proplists:get_value(Key, List, Default).
   
  +
  +-define(ERR_NAME(A, B), 
  +        #xqError{name =
  +                   #xqAtomicValue{value =
  +                                    #qname{namespace = A,local_name = B}}}).
  +-define(ERR_LOC(E), ((E#xqError.name)#xqAtomicValue.value)#qname.local_name).
  +
  +
  +%% ensure that errors from imported libraries are reported in the tests.
  +combined_error(Err, LibReturns) ->
  +   Sort = fun(?ERR_NAME(AN, AL), ?ERR_NAME(BN, BL)) ->
  +                {AN, AL} == {BN, BL}
  +          end,
  +   LibErrors = lists:usort(Sort, [E || 
  +                                  #xqError{} = E <- LibReturns,
  +                                  ?ERR_LOC(E) =/= <<"XQST0059">> % mod not found
  +                                  ]),
  +   ?dbg("LibErrors", LibErrors),
  +   case LibErrors of
  +      [H|_] ->
  +         %when ?ERR_LOC(Err) == <<"XQST0059">> ->
  +         H;
  +      _ ->
  +         Err
  +   end.
   
   handle_environment([]) -> {"",#{}};
   handle_environment(List) ->
  
positive.code:          assert_error/2,
           assert_string_value/2,
           assert_norm_string_value/2,
           assert_serialization_match/3]).
  
  -export([run/1,
           run_suite/1]).
  
  -export([handle_environment/1]).
  -export([load_qt3_xml/0]).
  
  -include("xqerl.hrl").
  
negative.code: 
  assert_serialization_match(#xqError{} = Err, _, _) ->
     {false, Err};
  assert_serialization_match(Result, SchemaRegex, Flags) when is_binary(Result) ->
     {ok, NormResult} = xs_regex:normalize(string_value(Result)),
     {ok, Norm} = xs_regex:normalize(SchemaRegex),
     {_, RE} = xs_regex:compile(Norm, Flags),
  