From b49b80bdf9f11c73e8b9dd4e2808c56c66584974 Mon Sep 17 00:00:00 2001 From: Feoramund <161657516+Feoramund@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:51:10 -0400 Subject: [PATCH] Add test for `count_digits_of_base` --- tests/core/math/test_core_math.odin | 36 ++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tests/core/math/test_core_math.odin b/tests/core/math/test_core_math.odin index 2a752e366..8d51c9da0 100644 --- a/tests/core/math/test_core_math.odin +++ b/tests/core/math/test_core_math.odin @@ -2,6 +2,7 @@ package test_core_math import "core:math" +import "core:strconv" import "core:testing" @test @@ -1229,4 +1230,37 @@ test_large_tan :: proc(t: ^testing.T) { f2 := math.tan(vf[i] + large) testing.expectf(t, close(t, f1, f2), "math.tan(%.15g) = %.15g, want %.15g", vf[i]+large, f2, f1) } -} \ No newline at end of file +} + +@test +test_count_digits :: proc(t: ^testing.T) { + _run_test :: proc(t: ^testing.T, $base: int) { + buf: [64]u8 + for n in 0..