strings — validation proof

Go’s own strings test suite, converted to C# by go2cs, built against the converted standard library, run under the Go-semantics test host, and compared verdict for verdict against a clean go test -json baseline of the same sources. This page is generated by the converter from that comparison — it is the evidence behind the strings row in Validated Test Packages.

Validated 2026-10-25 · converter 3e3f18925

68 matched · 5 disclosed — Go 1.26.10, windows/amd64, converted package src/core/strings.

Measured at Release (tiered JIT off), oracle go version go1.26.10 windows/amd64.

Verdicts

Test go test go2cs
TestBuilder pass pass
TestBuilderAllocs pass fail (disclosed)
TestBuilderCopyPanic pass pass
TestBuilderGrow pass fail (disclosed)
TestBuilderGrowSizeclasses pass fail (disclosed)
TestBuilderReset pass pass
TestBuilderString pass pass
TestBuilderWrite2 pass pass
TestBuilderWrite2/Write pass pass
TestBuilderWrite2/WriteRune pass pass
TestBuilderWrite2/WriteRuneWide pass pass
TestBuilderWrite2/WriteString pass pass
TestBuilderWriteByte pass pass
TestBuilderWriteInvalidRune pass pass
TestCaseConsistency pass pass
TestClone pass pass
TestCompare pass pass
TestCompareIdenticalString pass pass
TestCompareStrings pass pass
TestContains pass pass
TestContainsAny pass pass
TestContainsFunc pass pass
TestContainsRune pass pass
TestCount pass pass
TestCut pass pass
TestCutPrefix pass pass
TestCutSuffix pass pass
TestEmptyReaderConcurrent pass pass
TestEqualFold pass pass
TestFields pass pass
TestFieldsFunc pass pass
TestFinderCreation pass pass
TestFinderNext pass pass
TestGenericTrieBuilding pass pass
TestIndex pass pass
TestIndexAny pass pass
TestIndexByte pass pass
TestIndexFunc pass pass
TestIndexRandom pass pass
TestIndexRune pass fail (disclosed)
TestLastIndex pass pass
TestLastIndexAny pass pass
TestLastIndexByte pass pass
TestLines pass pass
TestMap pass pass
TestPickAlgorithm pass pass
TestReadAfterBigSeek pass pass
TestReadByte pass pass
TestReadRune pass pass
TestReader pass pass
TestReaderAt pass pass
TestReaderAtConcurrent pass pass
TestReaderLenSize pass pass
TestReaderReset pass pass
TestReaderZero pass pass
TestRepeat pass pass
TestRepeatCatchesOverflow pass pass
TestReplace pass fail (disclosed)
TestReplacer pass pass
TestRunes pass pass
TestSpecialCase pass pass
TestSplit pass pass
TestSplitAfter pass pass
TestTitle pass pass
TestToLower pass pass
TestToUpper pass pass
TestToValidUTF8 pass pass
TestTrim pass pass
TestTrimFunc pass pass
TestTrimSpace pass pass
TestUnreadRuneError pass pass
TestWriteStringError pass pass
TestWriteTo pass pass

Disclosed divergences

A disclosed divergence is a specific Go assertion this conversion does not satisfy — not a skipped test and not a tolerance. Each one is pinned by exact failure signature in the package’s hand-owned go2cs_test_disclosures.json; a disclosed test that fails any other way is still a hard mismatch.

The Class column says which kind each one is: a deferred entry is an assertion the managed CLR can meet, pinned against the named plan that will retire it; every other class is one it provably cannot satisfy.

Test Class Pinned reason
TestBuilderAllocs deferred Exact-count AllocsPerRun assert (want 1): Go’s issue-23382 check that copyCheck does not force the Builder to escape. The converted var b Builder is a heap box (ж) because copyCheck stores and compares the Builder's own address (src/core/strings/builder.cs:26-40), an identity-keyed boundary that reducing address-take boxes cannot remove. At go1.24.13 the two counted objects per run are that box and the element-reference box String() mints (ElemRefBox); the buffer, Go's one allocation, is not counted. At go1.26.10 it reads 3 per run on windows and linux, with an identical test body.
TestBuilderGrow deferred Exact-count AllocsPerRun asserts (want 1 per growLen>0 leg, want 0 for growLen=0): every failing leg reads a count of golib-runtime objects, Go’s own unit. The growLen=0 leg’s addressed Builder is heap-boxed per run (ж, strings/builder_test.cs:140) where Go's escape analysis keeps it on the stack; that box sits at an identity-keyed boundary, since copyCheck stores and compares the Builder's own address (strings/builder.cs:26-40), so reducing address-take boxes cannot remove it. String()'s element-reference box and the converted comparison operand `(@string)p` (strings/builder_test.cs:146) are counted as well.
TestBuilderGrowSizeclasses deferred Count-bound AllocsPerRun assert (want <= 1): the reading is a count, 3 per run: the ж box, the element-reference box String() mints (ElemRefBox) and the append regrow; the byte[18] MakeNoZero allocates is not counted. Go's Grow(18) rounds up to a 24-byte size class, so its 19-byte write fits without a regrow. The Builder box sits at an identity-keyed boundary: copyCheck stores and compares the Builder's own address (strings/builder.cs:26-40), so reducing address-take boxes cannot remove it.
TestIndexRune deferred Want-zero AllocsPerRun assert: IndexRune’s Index(s, string(r)) materializes a byte[] for string(r) in the managed model, where Go builds it in runtime.intstring’s 4-byte stack buffer; the index-semantics legs all pass. A transient one-rune string over a stack encoding, for a string(r) the callee does not retain, removes it.
TestReplace deferred AllocsPerRun check new at go1.26.10 (strings_test.go:1480; go1.24.13’s TestReplace has no allocation assertion): every Replace case must allocate at most one object (the result string), and the test fails a case with Replace(...) allocates N objects. The converted side reads 3.00 objects for 13 cases and 6.00 for Replace(“☺☻☹”, “”, “<>”, -1), 14 failure lines, on both OSes. The signature pins the allocates lines only, so a failure of TestReplace’s value asserts still fails the comparison.

Excluded declarations

Declarations filtered from both sides of the comparison, and therefore not claimed above: Benchmark, Fuzz and Example declarations the converted host does not execute, plus any test requiring a capability the managed runtime does not provide — a testing member the host has not implemented, or a platform behavior it provably cannot reproduce. Each is named with the capability it needs.