test/sandbox/assert: wrap printf

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-02 18:37:46 +09:00
parent d8e9d71f87
commit 0d3652b793
3 changed files with 9 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
package sandbox
func ReplaceFatal(f func(format string, v ...any)) { fatalfFunc = f }
type F func(format string, v ...any)
func SwapPrint(f F) (old F) { old = printfFunc; printfFunc = f; return }
func SwapFatal(f F) (old F) { old = fatalfFunc; fatalfFunc = f; return }