Skip to content

Rename of DoesContain to Contains? #10732

@philderbeast

Description

@philderbeast

I've noticed a small inconsistency in naming in cabal-testsuite. Could we make this change, using Contains universally as the opposite of DoesNotContain rather than DoesContain as the opposite?

- assertFileDoesContain :: MonadIO m => WithCallStack (FilePath -> String -> m ())
+ assertFileContains :: MonadIO m => WithCallStack (FilePath -> String -> m ())

The assert.*Contain[s]* functions:

$ grep -o 'assert.*DoesContain.*::' cabal-testsuite/src/Test/Cabal/Prelude.hs
assertFileDoesContain ::

$ grep -o 'assert.*Contains.*::' cabal-testsuite/src/Test/Cabal/Prelude.hs
assertOutputContains ::
assertAnyFileContains ::
assertNoFileContains ::

$ grep -o 'assert.*DoesNotContain.*::' cabal-testsuite/src/Test/Cabal/Prelude.hs
assertOutputDoesNotContain ::
assertFileDoesNotContain ::

Total hits, mostly uses:

$ grep -o 'assert.*DoesContain' ./cabal-testsuite/**/*.hs | wc -l
43

$ grep -o 'assert.*Contains' ./cabal-testsuite/**/*.hs | wc -l
275

$ grep -o 'assert.*DoesNotContain' ./cabal-testsuite/**/*.hs | wc -l
95

The assert.*Match.* functions are consistently named, using Matches and DoesNotMatch as suffix:

$ grep -Po 'assert.*Match.*::' cabal-testsuite/src/Test/Cabal/Prelude.hs
assertOutputMatches ::
assertOutputDoesNotMatch ::
assertGlobMatches ::
assertGlobDoesNotMatch ::
assertGlobMatchesTestDir ::
assertGlobDoesNotMatchTestDir ::

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions