fmt — validation proof

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

Validated 2026-10-25 · converter 3e3f18925

62 matched · 1 disclosed — Go 1.26.10, windows/amd64, converted package src/core/fmt.

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

Verdicts

Test go test go2cs
TestAppend pass pass
TestAppendf pass pass
TestAppendln pass pass
TestBadVerbRecursion pass pass
TestBlank pass pass
TestBlankln pass pass
TestComplexFormatting pass pass
TestCountMallocs pass fail (disclosed)
TestEOF pass pass
TestEOFAllTypes pass pass
TestEOFAtEndOfInput pass pass
TestEmptyMap pass pass
TestErrorf pass pass
TestFlagParser pass pass
TestFmtInterface pass pass
TestFormatString pass pass
TestFormatterFlags pass pass
TestFormatterPrintln pass pass
TestHexByte pass pass
TestHexBytes pass pass
TestInf pass pass
TestIsSpace pass pass
TestLineByLineFscanf pass pass
TestMapPrinter pass pass
TestMultiLine pass pass
TestNaN pass pass
TestNilDoesNotBecomeTyped pass pass
TestPanics pass pass
TestParsenum pass pass
TestReorder pass pass
TestScan pass pass
TestScan/DataErrReader pass pass
TestScan/OneByteReader pass pass
TestScan/ReaderOnly pass pass
TestScan/StringReader pass pass
TestScanEmpty pass pass
TestScanInts pass pass
TestScanMultiple pass pass
TestScanNewlinesAreSpaces pass pass
TestScanNotPointer pass pass
TestScanOverflow pass pass
TestScanStateCount pass pass
TestScanf pass pass
TestScanfMulti pass pass
TestScanfMulti/DataErrReader pass pass
TestScanfMulti/OneByteReader pass pass
TestScanfMulti/ReaderOnly pass pass
TestScanfMulti/StringReader pass pass
TestScanfNewlineMatchFormat pass pass
TestScanln pass pass
TestScanln/DataErrReader pass pass
TestScanln/OneByteReader pass pass
TestScanln/ReaderOnly pass pass
TestScanln/StringReader pass pass
TestScanlnNewlinesTerminate pass pass
TestScanlnNoNewline pass pass
TestScanlnWithMiddleNewline pass pass
TestSlicePrinter pass pass
TestSprintf pass pass
TestStringer pass pass
TestStructPrinter pass pass
TestUnreadRuneWithBufio pass pass
TestWidthAndPrecision 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
TestCountMallocs deferred An AllocsPerRun family over 24 Sprintf/Fprintf/Errorf legs. Since Go 1.26 each leg must EQUAL Go’s own mallocTest count (0 to 4); Go 1.24 asserted at most that count, and its message read want <=. 20 of the 24 legs differ in the converted run. Sprintf(“”) and Sprintf(“xxx”) match, and two noliteral legs (Fprintf(buf, “%x”) and Fprintf(buf, “%v”)) match only because one extra charge offsets one uncounted interface box. DEFERRED, not alloc-count-semantics: the run’s unit note reads counted ... go2cs-runtime object allocations ... an allocation COUNT per run – Go’s own unit. ONE mechanism is named and read, and it is paid by every Sprintf/Fprintf leg with arguments: the variadic pack. The call site is C# 13 params Span<any> (the compiler’s stack pack, like Go’s non-escaping …any backing array), and Sprintf/Fprintf’s first act, aʗp.slice(), copies it to the heap (golib slice.cs slice<T>(this Span<T>) -> AllocationCounter.CopyOf) – one charged array per call where Go allocates none. On 8 legs it is the whole difference: each reads Go’s count plus one. The REST is NOT yet attributed: 6 Sprintf/Fprintf legs carry 1 or 2 more than the pack, Fprintf(buf, “%x %x %x”) over three pointer arguments carries 12 more, and the 4 Errorf legs differ by 2 to 7 (Errorf copies its arguments through sslice(), not the charged slice()). One leg reads BELOW Go, Fprintf(buf, “%v”) of a []int at 3 against 4; the equality assertion now reports it, and the counter’s coverage allows it, because C# boxing is not counted. So this entry is deferred on a partially named mechanism and says so. RE-READ AT go1.26.10 (2026-10-25, G): reading moved from 20 per run at go1.24.13 to 1 per run on windows and linux; the test body changed between go1.24.13 and go1.26.10.

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.