bytes — validation proof

Go’s own bytes 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 bytes row in Validated Test Packages.

Validated 2026-08-04 · converter 34f593bf3

82 matched · 6 disclosed — Go 1.23.1, windows/amd64, converted package src/core/bytes.

Verdicts

Test go test go2cs
TestBasicOperations pass pass
TestBufferGrowNegative pass pass
TestBufferGrowth pass pass
TestBufferTruncateNegative pass pass
TestBufferTruncateOutOfRange pass pass
TestCapWithPreallocatedSlice pass pass
TestCapWithSliceAndWrittenData pass pass
TestClone pass pass
TestCompare pass pass
TestCompareBytes pass pass
TestCompareIdenticalSlice pass pass
TestContains pass pass
TestContainsAny pass pass
TestContainsFunc pass pass
TestContainsRune pass pass
TestCountByte pass pass
TestCountByteNoMatch pass pass
TestCut pass pass
TestCutPrefix pass pass
TestCutSuffix pass pass
TestEmptyReaderConcurrent pass pass
TestEndianBaseCompare pass pass
TestEqual pass pass
TestEqualExhaustive pass pass
TestEqualFold pass pass
TestFields pass pass
TestFieldsFunc pass pass
TestGrow pass fail (disclosed)
TestGrowOverflow pass pass
TestIndex pass fail (disclosed)
TestIndexAny pass pass
TestIndexByte pass pass
TestIndexByteBig pass pass
TestIndexByteSmall pass pass
TestIndexFunc pass pass
TestIndexRune pass fail (disclosed)
TestLargeByteReads pass pass
TestLargeByteWrites pass pass
TestLargeStringReads pass pass
TestLargeStringWrites pass pass
TestLastIndex pass fail (disclosed)
TestLastIndexAny pass pass
TestLastIndexByte pass pass
TestMap pass pass
TestMixedReadsAndWrites pass pass
TestNewBuffer pass pass
TestNewBufferShallow pass fail (disclosed)
TestNewBufferString pass pass
TestNext pass pass
TestNil pass pass
TestNotEqual pass pass
TestReadAfterBigSeek pass pass
TestReadBytes pass pass
TestReadEmptyAtEOF pass pass
TestReadFrom pass pass
TestReadFromNegativeReader pass pass
TestReadFromPanicReader pass pass
TestReadString pass pass
TestReader pass pass
TestReaderAt pass pass
TestReaderAtConcurrent pass pass
TestReaderCopyNothing pass pass
TestReaderDoubleUnreadRune pass pass
TestReaderLen pass pass
TestReaderLenSize pass pass
TestReaderReset pass pass
TestReaderWriteTo pass pass
TestReaderZero pass pass
TestRepeat pass pass
TestRepeatCatchesOverflow pass pass
TestReplace pass pass
TestRuneIO pass pass
TestRunes pass pass
TestSplit pass pass
TestSplitAfter pass pass
TestTitle pass pass
TestToLower pass pass
TestToTitle pass pass
TestToUpper pass pass
TestToValidUTF8 pass pass
TestTrim pass pass
TestTrimFunc pass pass
TestTrimSpace pass pass
TestUnreadByte pass pass
TestUnreadRuneError pass pass
TestWriteAppend pass fail (disclosed)
TestWriteInvalidRune pass pass
TestWriteTo pass pass

Disclosed divergences

A disclosed divergence is a specific Go assertion the managed CLR provably cannot 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.

Test Class Pinned reason
TestGrow alloc-profile want-zero AllocsPerRun assert: the converted Buffer.Grow/Write path allocates in the managed slice model where Go’s pre-grown buffer writes allocation-free
TestIndex alloc-profile want-zero AllocsPerRun assert: the converted Index search allocates in the managed runtime where Go’s compiler stack-allocates its working state
TestIndexRune alloc-profile want-zero AllocsPerRun assert: string(r) materializes a byte[] in the managed model where Go uses a 4-byte stack buffer (runtime.intstring)
TestLastIndex alloc-profile want-zero AllocsPerRun assert: the converted LastIndex search allocates in the managed runtime where Go’s compiler stack-allocates its working state
TestNewBufferShallow alloc-profile want-zero AllocsPerRun assert: the addressed Buffer copy heap-boxes per run in the managed model (ref var through the heap) where Go’s escape analysis keeps the shallow copy on the stack
TestWriteAppend alloc-profile want-zero AllocsPerRun assert: the converted AvailableBuffer/AppendInt/Write loop allocates in the managed slice model where Go’s sufficiently-sized buffer appends allocation-free

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.