Skip to content

toContain.exactly.matchFor doesn't work if BnMS Node is used in Pattern #1884

@robstoll

Description

@robstoll

Affected Version

1.2.0

API

fluent, infix

Platform

jvm

Kotlin Version

2.0.21

How to reproduce the problem?

expect("🚩️ size        : 0").toContain.exactly(1).regex("🚩️ s")

Describe the bug

fails with (from proof branch):

I expected subject : "🚩️ size        : 0"
🚩️ to contain : 
   🚩️ string matching regex : 🚩️ s        (kotlin.text.Regex <162083492>)
      🚩️ ▶ number of matches : 2
           🚫️ is exactly     : 1

This is an edge case, it works if the pattern does not resolve to BnMS Node. For instance, the following works as expected:

expect("🚩️ size        : 0").toContain.exactly(1).regex("🚩️")

Expected behaviour

should also find just one occurrence

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions