fix for nimInAction
This commit is contained in:
parent
161e14829a
commit
6946116272
16 changed files with 88 additions and 33 deletions
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import os, threadpool, asyncdispatch, asyncnet
|
||||
import protocol
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import asyncdispatch, asyncnet
|
||||
|
||||
type
|
||||
|
|
@ -81,4 +85,4 @@ when isMainModule:
|
|||
echo("Server initialised!")
|
||||
# Execute the ``loop`` procedure. The ``waitFor`` procedure will run the
|
||||
# asyncdispatch event loop until the ``loop`` procedure finishes executing.
|
||||
waitFor loop(server)
|
||||
waitFor loop(server)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
discard """
|
||||
output: '''
|
||||
Future is no longer empty, 42
|
||||
'''
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
proc foo: string = "Dog"
|
||||
var x: FlowVar[string] = spawn foo()
|
||||
|
|
@ -33,9 +39,9 @@ let data = """
|
|||
{"username": "Dominik"}
|
||||
"""
|
||||
|
||||
let obj = parseJson(data)
|
||||
assert obj.kind == JObject
|
||||
assert obj["username"].kind == JString
|
||||
let obj = parseJson(data)
|
||||
assert obj.kind == JObject
|
||||
assert obj["username"].kind == JString
|
||||
assert obj["username"].str == "Dominik"
|
||||
|
||||
block:
|
||||
|
|
@ -60,12 +66,12 @@ var amy = Human(name: "Amy", age: 20)
|
|||
|
||||
import asyncdispatch
|
||||
|
||||
var future = newFuture[int]()
|
||||
doAssert(not future.finished)
|
||||
var future = newFuture[int]()
|
||||
doAssert(not future.finished)
|
||||
|
||||
future.callback =
|
||||
proc (future: Future[int]) =
|
||||
echo("Future is no longer empty, ", future.read)
|
||||
future.callback =
|
||||
proc (future: Future[int]) =
|
||||
echo("Future is no longer empty, ", future.read)
|
||||
|
||||
future.complete(42)
|
||||
|
||||
|
|
@ -85,9 +91,8 @@ import asyncdispatch, asyncfile, os
|
|||
proc readFiles() {.async.} =
|
||||
# --- Changed to getTempDir here.
|
||||
var file = openAsync(getTempDir() / "test.txt", fmReadWrite)
|
||||
let data = await file.readAll()
|
||||
echo(data)
|
||||
await file.write("Hello!\n")
|
||||
let data = await file.readAll()
|
||||
echo(data)
|
||||
await file.write("Hello!\n")
|
||||
|
||||
waitFor readFiles()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
# See this page for info about the format https://wikitech.wikimedia.org/wiki/Analytics/Data/Pagecounts-all-sites
|
||||
import tables, parseutils, strutils, threadpool
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
# See this page for info about the format https://wikitech.wikimedia.org/wiki/Analytics/Data/Pagecounts-all-sites
|
||||
import tables, parseutils, strutils, threadpool, re
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
# See this page for info about the format https://wikitech.wikimedia.org/wiki/Analytics/Data/Pagecounts-all-sites
|
||||
import tables, parseutils, strutils
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import os, parseutils, threadpool, strutils
|
||||
|
||||
type
|
||||
|
|
@ -69,4 +73,4 @@ proc readPageCounts(filename: string, chunkSize = 1_000_000) =
|
|||
when isMainModule:
|
||||
const file = "pagecounts-20160101-050000"
|
||||
let filename = getCurrentDir() / file
|
||||
readPageCounts(filename)
|
||||
readPageCounts(filename)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
|
||||
var counter = 0
|
||||
|
|
@ -10,4 +14,4 @@ proc increment(x: int) =
|
|||
spawn increment(10_000)
|
||||
spawn increment(10_000)
|
||||
sync()
|
||||
echo(counter)
|
||||
echo(counter)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import os, parseutils
|
||||
|
||||
proc parse(line: string, domainCode, pageTitle: var string,
|
||||
|
|
@ -31,4 +35,4 @@ proc readPageCounts(filename: string) =
|
|||
when isMainModule:
|
||||
const file = "pagecounts-20160101-050000"
|
||||
let filename = getCurrentDir() / file
|
||||
readPageCounts(filename)
|
||||
readPageCounts(filename)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
discard """
|
||||
output: "Database created successfully!"
|
||||
"""
|
||||
|
||||
import database
|
||||
|
||||
var db = newDatabase()
|
||||
db.setup()
|
||||
echo("Database created successfully!")
|
||||
db.close()
|
||||
db.close()
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import asyncdispatch, times
|
||||
|
||||
import jester
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
outputsub: "All tests finished successfully!"
|
||||
"""
|
||||
|
||||
import database, os, times
|
||||
|
||||
when isMainModule:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import dom
|
||||
|
||||
type
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
import os
|
||||
import sdl
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
discard """
|
||||
disabled: "windows"
|
||||
action: compile
|
||||
disabled: "windows"
|
||||
"""
|
||||
|
||||
import sfml, os
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue