8000 Deprecate StringSubject.doesNotMatch? · Issue #790 · google/truth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Deprecate StringSubject.doesNotMatch? #790
Open
@cpovirk

Description

@cpovirk

As noted in #789 (comment), it's very frequently misused.

Users who want that behavior would likely be better served by having to opt into it more explicitly with a call like doesNotContainMatch("(?s)^.*something.*$"). Unfortunately, even that is likely to lead to misuse: If users omit (?s), then . does not match newlines, so any string with a newline will pass a test like doesNotContainMatch("^.*something.*$") :( Perhaps our regex methods would ideally have enabled (?s) by default. But then that would be different from the Pattern-accepting overloads. There is no great solution here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3not scheduledtype=defectBug, not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0