summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2021-06-28 15:00:14 +0200
committerGitHub <noreply@github.com>2021-06-28 15:00:14 +0200
commit6e74fecb4275272e5224e2a0ba45df5ca2c40b82 (patch)
tree7c675a2c5cbec85bc586b85bd2ef699049129935 /tests
parente720bbdd76303e2cc0a3a169e870859470a1da84 (diff)
downloadNim-6e74fecb4275272e5224e2a0ba45df5ca2c40b82.tar.gz
Simplify addInt, remove digits10 (#18356)
* Simplify addInt, remove digits10

Co-authored-by: Charles Blake <charlechaud@gmail.com>

* Fix bootstrapping

* Add noInit to tmp array

* noInit -> noinit

Co-authored-by: Charles Blake <charlechaud@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tdigitsutils.nim23
1 files changed, 0 insertions, 23 deletions
diff --git a/tests/stdlib/tdigitsutils.nim b/tests/stdlib/tdigitsutils.nim
deleted file mode 100644
index 7cf63411f..000000000
--- a/tests/stdlib/tdigitsutils.nim
+++ /dev/null
@@ -1,23 +0,0 @@
-import std/private/digitsutils
-
-template main =
-  block: # digits10
-    doAssert digits10(0'u64) == 1
-    # checks correctness on all powers of 10 + [0,-1,1]
-    var x = 1'u64
-    var num = 1
-    while true:
-      # echo (x, num)
-      doAssert digits10(x) == num
-      doAssert digits10(x+1) == num
-      if x > 1:
-        doAssert digits10(x-1) == num - 1
-      num += 1
-      let xOld = x
-      x *= 10
-      if x < xOld:
-        # wrap-around
-        break
-
-static: main()
-main()