mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 12:54:22 +00:00
some test cleanups & category reorganization (#22010)
* clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
This commit is contained in:
31
tests/template/tidentconcatenations.nim
Normal file
31
tests/template/tidentconcatenations.nim
Normal file
@@ -0,0 +1,31 @@
|
||||
type
|
||||
Hash*[bits: static[int]] = object
|
||||
data*: array[bits div 8, uint8]
|
||||
|
||||
{.emit: """
|
||||
|
||||
void sha_256(void* input, int input_len, void* output, int output_len) {}
|
||||
void sha_512(void* input, int input_len, void* output, int output_len) {}
|
||||
|
||||
void keccak_256(void* input, int input_len, void* output, int output_len) {}
|
||||
void keccak_512(void* input, int input_len, void* output, int output_len) {}
|
||||
|
||||
""".}
|
||||
|
||||
template defineKeccak(bits: untyped) =
|
||||
proc `extKeccak bits`(output: pointer, outSize: csize_t, input: pointer, inputSize: csize_t) {.nodecl, importc: "keccak_" & astToStr(bits).}
|
||||
|
||||
template defineSha(bits: static[int]) =
|
||||
proc `extSha bits`(output: pointer, outSize: csize_t, input: pointer, inputSize: csize_t) {.nodecl, importc: "sha_" & astToStr(bits).}
|
||||
|
||||
template defineHashProcs(bits) =
|
||||
defineSha(bits)
|
||||
defineKeccak(bits)
|
||||
|
||||
defineHashProcs(256)
|
||||
defineHashProcs(512)
|
||||
|
||||
extSha256(nil, 0, nil, 0)
|
||||
extSha512(nil, 0, nil, 0)
|
||||
extKeccak256(nil, 0, nil, 0)
|
||||
extKeccak512(nil, 0, nil, 0)
|
||||
@@ -1,9 +1,6 @@
|
||||
discard """
|
||||
disabled: true
|
||||
output: "####"
|
||||
joinable: false
|
||||
"""
|
||||
# unfortunately our tester doesn't support multiple lines of compiler
|
||||
# error messages yet...
|
||||
|
||||
# bug #1562
|
||||
type Foo* {.pure, final.} = object
|
||||
@@ -30,4 +27,4 @@ import sequtils
|
||||
|
||||
(var i = @[""];i).applyIt(it)
|
||||
# now works:
|
||||
echo "##", i[0], "##"
|
||||
doAssert i[0] == ""
|
||||
|
||||
Reference in New Issue
Block a user