Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename of DoesContain to Contains? #10732

Open
philderbeast opened this issue Jan 9, 2025 · 0 comments
Open

Rename of DoesContain to Contains? #10732

philderbeast opened this issue Jan 9, 2025 · 0 comments

Comments

@philderbeast
Copy link
Collaborator

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 ::
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant