aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox/assert_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-02 18:37:46 +0900
committerOphestra <cat@gensokyo.uk>2025-03-02 18:37:46 +0900
commit0d3652b793f6dc238667db3ea7939f76e49948c8 (patch)
treec742ebb028bfe8424b70ac0ca2a6b15316417458 /test/sandbox/assert_test.go
parentd8e9d71f87db912d73345fec2f9fcb61b25231cf (diff)
test/sandbox/assert: wrap printf
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox/assert_test.go')
-rw-r--r--test/sandbox/assert_test.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/sandbox/assert_test.go b/test/sandbox/assert_test.go
index f2b7f99f..3727f57f 100644
--- a/test/sandbox/assert_test.go
+++ b/test/sandbox/assert_test.go
@@ -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 }