-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce some changes/additions from test/use-cases branch
But without introducing the use cases tests themselves nor their dependencies in vendor.
- Loading branch information
1 parent
b2442ec
commit a87f3f8
Showing
7 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
type | ||
ThreadSafeString* = distinct cstring | ||
|
||
proc safe*(input: string): ThreadSafeString = | ||
var res = cast[cstring](allocShared(input.len + 1)) | ||
copyMem(res, input.cstring, input.len) | ||
res[input.len] = '\0' | ||
res.ThreadSafeString | ||
|
||
proc `$`*(input: ThreadSafeString): string = | ||
result = $(input.cstring) | ||
deallocShared input.cstring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import chronos, unittest | ||
|
||
template asyncTest*(name, body: untyped) = | ||
test name: | ||
proc scenario {.async.} = body | ||
waitFor scenario() | ||
|
||
template procSuite*(name, body: untyped) = | ||
proc suitePayload = | ||
suite name: | ||
body | ||
suitePayload() |
Submodule nimbus-build-system
updated
3 files
+1 −1 | makefiles/targets.mk | |
+3 −1 | scripts/build_nim.sh | |
+1 −1 | vendor/Nim |