fix for nimInAction

This commit is contained in:
Arne Döring 2018-11-20 11:08:18 +01:00 • committed by Araq
commit 6946116272
16 changed files with 88 additions and 33 deletions

View file

@ -1,3 +1,7 @@
discard """
action: compile
"""
import os, threadpool, asyncdispatch, asyncnet
import protocol

View file

@ -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)

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -1,6 +1,10 @@
discard """
output: "Database created successfully!"
"""
import database
var db = newDatabase()
db.setup()
echo("Database created successfully!")
db.close()
db.close()

View file

@ -1,3 +1,7 @@
discard """
action: compile
"""
import asyncdispatch, times
import jester

View file

@ -1,3 +1,7 @@
discard """
outputsub: "All tests finished successfully!"
"""
import database, os, times
when isMainModule:

View file

@ -1,3 +1,7 @@
discard """
action: compile
"""
import dom
type

View file

@ -1,3 +1,7 @@
discard """
action: compile
"""
import os
import sdl

View file

@ -1,5 +1,6 @@
discard """
disabled: "windows"
action: compile
disabled: "windows"
"""
import sfml, os