This is an automated email from the ASF dual-hosted git repository.

FreeAndNil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ed3d554 warn about culture sensitive substring assertions
9ed3d554 is described below

commit 9ed3d554ffdbd08fc64cb06fbfa20b012b23a170
Author: Jan Friedrich <[email protected]>
AuthorDate: Wed Sep 2 06:30:40 2026 +0200

    warn about culture sensitive substring assertions
    
    Does.Contain has no comparison parameter, and linguistic comparison skips
    ignorable characters, so Does.Not.Contain matches a NUL that is not there. 
It
    cost a red CI on two escape tests.
---
 CLAUDE.md | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/CLAUDE.md b/CLAUDE.md
index ecbe7c6a..548b9144 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -153,6 +153,12 @@ almost always be doing.
 - Drive a test over a background thread with gates (`ManualResetEventSlim`), 
never with
   `Thread.Sleep`: park the worker, assert the state you care about, then 
release it. See
   `BackgroundSenderTest`, where every wait has a generous timeout and the 
assertions are exact.
+- **`Does.Contain` is culture sensitive and cannot be made ordinal**: its 
`ContainsConstraint` has
+  no comparison parameter. Linguistic comparison skips ignorable characters, 
so `Does.Not.Contain`
+  reports a match for NUL, soft hyphen or a zero-width character in a string 
that holds none. When
+  the assertion is about control characters, use
+  `Contains.Substring(x).Using(StringComparison.Ordinal)`, negated with the 
`!` operator that
+  `Constraint` defines, or assert the whole value with `Is.EqualTo`, which is 
ordinal.
 - Mark a test `[NonParallelizable]` when it mutates static state 
(`LogLog.InternalDebugging`, a
   static field on a test double, a process-wide native registration).
 - Wrap expected internal logging in 
`LogLog.ExecuteWithoutEmittingInternalMessages(...)` and capture

Reply via email to