Class MatchersKt

  • All Implemented Interfaces:

    
    public final class MatchersKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any, U extends Any> Matcher<T> transformingCollectionMatcher(Collection<U> expected, Function1<Collection<U>, Matcher<Collection<U>>> matcher, Function1<T, Collection<U>> transform) A helper function to create a custom matcher that compares an expected collection to a collection obtained by transform using the provided matcher.
      final static <T extends Any, U extends Any> Matcher<T> transformingCollectionEmptyMatcher(Function1<T, Collection<U>> transform) A helper function to create custom matchers that assert that the collection obtained by transform is empty.
      final static Matcher<String> matchExpectedResult(File expectedResultFile, File definitionFile, Map<String, String> custom, Integer contextSize) A matcher for comparing to expected result files, in particular serialized ProjectAnalyzerResults and OrtResults, that displays a unified diff with the given contextSize if the results do not match.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • transformingCollectionMatcher

         final static <T extends Any, U extends Any> Matcher<T> transformingCollectionMatcher(Collection<U> expected, Function1<Collection<U>, Matcher<Collection<U>>> matcher, Function1<T, Collection<U>> transform)

        A helper function to create a custom matcher that compares an expected collection to a collection obtained by transform using the provided matcher.

      • transformingCollectionEmptyMatcher

         final static <T extends Any, U extends Any> Matcher<T> transformingCollectionEmptyMatcher(Function1<T, Collection<U>> transform)

        A helper function to create custom matchers that assert that the collection obtained by transform is empty.

      • matchExpectedResult

         final static Matcher<String> matchExpectedResult(File expectedResultFile, File definitionFile, Map<String, String> custom, Integer contextSize)

        A matcher for comparing to expected result files, in particular serialized ProjectAnalyzerResults and OrtResults, that displays a unified diff with the given contextSize if the results do not match. If the Kotest system property named "kotest.assertions.multi-line-diff" is set to "simple", this just falls back to equalityMatcher.