
  -spec erlang:match_spec_test(MatchAgainst, MatchSpec, Type) ->
                                  TestResult
                                  when
                                      MatchAgainst :: [term()] | tuple(),
                                      MatchSpec :: term(),
                                      Type :: table | trace,
                                      TestResult ::
                                          {ok,
                                           term(),
                                           [return_trace],
                                           [{error | warning, string()}]} |
                                          {error,
                                           [{error | warning, string()}]}.

Since:
  OTP 19.0

  Tests a match specification used in calls to ets:select/2 and 
  erlang:trace_pattern/3. The function tests both a match
  specification for "syntactic" correctness and runs the match
  specification against the object. If the match specification
  contains errors, the tuple {error, Errors} is returned, where 
  Errors is a list of natural language descriptions of what was
  wrong with the match specification.

  If Type is table, the object to match against is to be a
  tuple. The function then returns {ok,Result,[],Warnings}, where 
  Result is what would have been the result in a real ets:select/2
  call, or false if the match specification does not match the
  object tuple.

  If Type is trace, the object to match against is to be a list.
  The function returns {ok, Result, Flags, Warnings}, where 
  Result is one of the following:

   • true if a trace message is to be emitted

   • false if a trace message is not to be emitted

   • The message term to be appended to the trace message

  Flags is a list containing all the trace flags to be enabled,
  currently this is only return_trace.

  This is a useful debugging and test tool, especially when writing
  complicated match specifications.

  See also ets:test_ms/2.
