summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-05-02 16:49:17 +0800
committerGitHub <noreply@github.com>2023-05-02 10:49:17 +0200
commitafc30ca87948c11f603f6686d4b10d3dcc27776a (patch)
treed52781ac11128914f43fce51fa8c59fb54bb7acf /tests
parent2844ac8b5eb6efce18e10b246e874719b20d36b2 (diff)
downloadNim-afc30ca87948c11f603f6686d4b10d3dcc27776a.tar.gz
fixes #19863; move sha1, md5 to nimble packages for 2.0 (#21702)
* move sha1, md5 to nimble packages

* boot the compiler

* fixes tests

* build the documentation

* fixes docs

* lol, I forgot koch.nim

* add `nimHasChecksums` define

* clone checksums but maybe copying is better

* bump nimble hash

* use ChecksumsStableCommit

* fixes tests

* deprecate them

* fixes paths

* fixes koch
Diffstat (limited to 'tests')
-rw-r--r--tests/effects/tstrict_funcs_imports.nim2
-rw-r--r--tests/js/tstdlib_imports.nim2
-rw-r--r--tests/manyloc/keineschweine/enet_server/server_utils.nim4
-rw-r--r--tests/manyloc/keineschweine/lib/client_helpers.nim4
-rw-r--r--tests/manyloc/keineschweine/lib/sg_assets.nim4
-rw-r--r--tests/manyloc/keineschweine/lib/sg_packets.nim4
-rw-r--r--tests/manyloc/keineschweine/server/old_dirserver.nim4
-rw-r--r--tests/manyloc/keineschweine/server/old_server_utils.nim4
-rw-r--r--tests/manyloc/keineschweine/server/sg_lobby.nim3
-rw-r--r--tests/stdlib/tmd5.nim18
-rw-r--r--tests/stdlib/tsha1.nim28
-rw-r--r--tests/test_nimscript.nims2
-rw-r--r--tests/vm/tsignaturehash.nim2
13 files changed, 22 insertions, 59 deletions
diff --git a/tests/effects/tstrict_funcs_imports.nim b/tests/effects/tstrict_funcs_imports.nim
index 53f346236..bf68b61b2 100644
--- a/tests/effects/tstrict_funcs_imports.nim
+++ b/tests/effects/tstrict_funcs_imports.nim
@@ -66,7 +66,6 @@ import
   macros,
   marshal,
   math,
-  md5,
   memfiles,
   mersenne,
   mimetypes,
@@ -155,7 +154,6 @@ import std/[
   monotimes,
   packedsets,
   setutils,
-  sha1,
   socketstreams,
   stackframes,
   sums,
diff --git a/tests/js/tstdlib_imports.nim b/tests/js/tstdlib_imports.nim
index 214c0f783..db851ba28 100644
--- a/tests/js/tstdlib_imports.nim
+++ b/tests/js/tstdlib_imports.nim
@@ -62,7 +62,7 @@ import std/[
   htmlgen,
 
   # Hashing:
-  base64, hashes, md5,
+  base64, hashes,
   # fails due to cstring cast/endians import: oids
   # fails due to copyMem/endians import: sha1
 
diff --git a/tests/manyloc/keineschweine/enet_server/server_utils.nim b/tests/manyloc/keineschweine/enet_server/server_utils.nim
index 1fb8326ed..3940dcf01 100644
--- a/tests/manyloc/keineschweine/enet_server/server_utils.nim
+++ b/tests/manyloc/keineschweine/enet_server/server_utils.nim
@@ -1,4 +1,6 @@
-import enet, sg_packets, estreams, md5, zlib_helpers, client_helpers, strutils,
+import ../../../../dist/checksums/src/checksums/md5
+
+import enet, sg_packets, estreams, zlib_helpers, client_helpers, strutils,
   idgen, sg_assets, tables, os
 type
   PClient* = ref object
diff --git a/tests/manyloc/keineschweine/lib/client_helpers.nim b/tests/manyloc/keineschweine/lib/client_helpers.nim
index b535225dc..b21e67cf7 100644
--- a/tests/manyloc/keineschweine/lib/client_helpers.nim
+++ b/tests/manyloc/keineschweine/lib/client_helpers.nim
@@ -1,6 +1,8 @@
+import ../../../../dist/checksums/src/checksums/md5
+
 import
   tables, sg_packets, enet, estreams, sg_gui, sfml,
-  zlib_helpers, md5, sg_assets, os
+  zlib_helpers, sg_assets, os
 type
   PServer* = ptr TServer
   TServer* = object
diff --git a/tests/manyloc/keineschweine/lib/sg_assets.nim b/tests/manyloc/keineschweine/lib/sg_assets.nim
index 5929add43..96c962dc3 100644
--- a/tests/manyloc/keineschweine/lib/sg_assets.nim
+++ b/tests/manyloc/keineschweine/lib/sg_assets.nim
@@ -1,6 +1,8 @@
+import ../../../../dist/checksums/src/checksums/md5
+
 import
   re, json, strutils, tables, math, os, math_helpers,
-  sg_packets, md5, zlib_helpers
+  sg_packets, zlib_helpers
 
 when defined(NoSFML):
   import server_utils
diff --git a/tests/manyloc/keineschweine/lib/sg_packets.nim b/tests/manyloc/keineschweine/lib/sg_packets.nim
index 0727c699a..797a60706 100644
--- a/tests/manyloc/keineschweine/lib/sg_packets.nim
+++ b/tests/manyloc/keineschweine/lib/sg_packets.nim
@@ -1,4 +1,6 @@
-import genpacket_enet, nativesockets, net, md5, enet
+import ../../../../dist/checksums/src/checksums/md5
+
+import genpacket_enet, nativesockets, net, enet
 defPacketImports()
 
 type
diff --git a/tests/manyloc/keineschweine/server/old_dirserver.nim b/tests/manyloc/keineschweine/server/old_dirserver.nim
index cd2b60b26..70ae05b0b 100644
--- a/tests/manyloc/keineschweine/server/old_dirserver.nim
+++ b/tests/manyloc/keineschweine/server/old_dirserver.nim
@@ -1,9 +1,9 @@
 ## directory server
 ## handles client authorization and assets
-
+import ../../../dist/checksums/src/checksums/md5
 import
   sockets, times, streams, streams_enh, tables, json, os,
-  sg_packets, sg_assets, md5, server_utils, map_filter
+  sg_packets, sg_assets, server_utils, map_filter
 type
   THandler = proc(client: PCLient; stream: PStream)
 var
diff --git a/tests/manyloc/keineschweine/server/old_server_utils.nim b/tests/manyloc/keineschweine/server/old_server_utils.nim
index 3da6e078c..f389c0836 100644
--- a/tests/manyloc/keineschweine/server/old_server_utils.nim
+++ b/tests/manyloc/keineschweine/server/old_server_utils.nim
@@ -1,5 +1,7 @@
+import ../../../dist/checksums/src/checksums/md5
+
 import
-  streams, md5, sockets,
+  streams, sockets,
   sg_packets, zlib_helpers, idgen
 type
   TClientType* = enum
diff --git a/tests/manyloc/keineschweine/server/sg_lobby.nim b/tests/manyloc/keineschweine/server/sg_lobby.nim
index d7e01e6e6..04ce10f08 100644
--- a/tests/manyloc/keineschweine/server/sg_lobby.nim
+++ b/tests/manyloc/keineschweine/server/sg_lobby.nim
@@ -1,6 +1,7 @@
+import ../../../dist/checksums/src/checksums/md5
 
 import
-  sockets, streams, tables, times, math, strutils, json, os, md5,
+  sockets, streams, tables, times, math, strutils, json, os,
   sfml, sfml_vector, sfml_colors,
   streams_enh, input_helpers, zlib_helpers, client_helpers, sg_packets, sg_assets, sg_gui
 type
diff --git a/tests/stdlib/tmd5.nim b/tests/stdlib/tmd5.nim
deleted file mode 100644
index 37c2f17d7..000000000
--- a/tests/stdlib/tmd5.nim
+++ /dev/null
@@ -1,18 +0,0 @@
-discard """
-  matrix: "--mm:refc; --mm:orc"
-  targets: "c cpp js"
-"""
-
-import md5
-import std/assertions
-
-proc main() {.raises: [].} =
-  doAssert(getMD5("Franz jagt im komplett verwahrlosten Taxi quer durch Bayern") ==
-    "a3cca2b2aa1e3b5b3b5aad99a8529074")
-  doAssert(getMD5("Frank jagt im komplett verwahrlosten Taxi quer durch Bayern") ==
-    "7e716d0e702df0505fc72e2b89467910")
-  doAssert($toMD5("") == "d41d8cd98f00b204e9800998ecf8427e")
-
-main()
-
-static: main()
diff --git a/tests/stdlib/tsha1.nim b/tests/stdlib/tsha1.nim
deleted file mode 100644
index 50bf392c5..000000000
--- a/tests/stdlib/tsha1.nim
+++ /dev/null
@@ -1,28 +0,0 @@
-discard """
-  matrix: "--mm:refc; --mm:orc"
-"""
-
-import std/sha1
-import std/assertions
-
-let hash1 = secureHash("a93tgj0p34jagp9[agjp98ajrhp9aej]")
-doAssert hash1 == hash1
-doAssert parseSecureHash($hash1) == hash1
-
-template checkVector(s, exp: string) =
-  doAssert secureHash(s) == parseSecureHash(exp)
-
-checkVector("", "da39a3ee5e6b4b0d3255bfef95601890afd80709")
-checkVector("abc", "a9993e364706816aba3e25717850c26c9cd0d89d")
-checkVector("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
-            "84983e441c3bd26ebaae4aa1f95129e5e54670f1")
-
-proc testIsValidSha1Hash =
-  doAssert not isValidSha1Hash("")
-  doAssert not isValidSha1Hash("042D4BE2B90ED0672E717D71850ABDB0A2D19CD11")
-  doAssert not isValidSha1Hash("042G4BE2B90ED0672E717D71850ABDB0A2D19CD1")
-  doAssert isValidSha1Hash("042D4BE2B90ED0672E717D71850ABDB0A2D19CD1")
-  doAssert isValidSha1Hash("042d4be2b90ed0672e717d71850abdb0a2d19cd1")
-  doAssert isValidSha1Hash("042d4be2b90ed0672e717D71850ABDB0A2D19CD1")
-
-testIsValidSha1Hash()
diff --git a/tests/test_nimscript.nims b/tests/test_nimscript.nims
index 725e75ebc..32b7d1416 100644
--- a/tests/test_nimscript.nims
+++ b/tests/test_nimscript.nims
@@ -64,7 +64,7 @@ import std/[
   htmlgen,
 
   # Hashing:
-  base64, hashes, md5,
+  base64, hashes,
   # fails due to cstring cast/times import/endians import: oids
   # fails due to copyMem/endians import: sha1
 
diff --git a/tests/vm/tsignaturehash.nim b/tests/vm/tsignaturehash.nim
index 42e0a1571..972ec6fb0 100644
--- a/tests/vm/tsignaturehash.nim
+++ b/tests/vm/tsignaturehash.nim
@@ -1,7 +1,7 @@
 # test sym digest is computable at compile time
 
 import macros, algorithm
-import md5
+import ../../dist/checksums/src/checksums/md5
 
 macro testmacro(s: typed{nkSym}): string =
   let s = getMD5(signaturehash(s) & " - " & symBodyHash(s))