formatting fixes, add editorconfig, remove garbage from nimble file
This commit is contained in:
parent
f70988020b
commit
5509594cd9
|
@ -0,0 +1,5 @@
|
|||
[*]
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
|
@ -1,19 +1,13 @@
|
|||
# Package
|
||||
|
||||
version = "0.1.0"
|
||||
author = "gmega"
|
||||
author = "Swarmsim Authors"
|
||||
description = "Simple swarm simulator"
|
||||
license = "MIT"
|
||||
srcDir = "src"
|
||||
srcDir = "."
|
||||
installExt = @["nim"]
|
||||
bin = @["swarm_sim"]
|
||||
|
||||
requires "nim >= 1.6.0"
|
||||
|
||||
# Dependencies
|
||||
|
||||
requires "nim >= 2.0.0"
|
||||
|
||||
|
||||
# Tasks
|
||||
task test, "Run unit tests":
|
||||
exec "nim c -r tests/all_tests.nim"
|
||||
exec "nim c -r tests/all_tests.nim"
|
||||
|
|
|
@ -22,10 +22,10 @@ proc nextStep*(self: EventDrivenEngine): Option[Schedulable] =
|
|||
schedulable.scheduled(engine = self)
|
||||
|
||||
some(schedulable)
|
||||
|
||||
|
||||
proc run*(self: EventDrivenEngine): void =
|
||||
while self.nextStep().isSome:
|
||||
discard
|
||||
|
||||
|
||||
export EventDrivenEngine
|
||||
export options
|
||||
export options
|
||||
|
|
|
@ -6,4 +6,4 @@ func `<`*(self: Schedulable, other: Schedulable): bool =
|
|||
method scheduled*(self: Schedulable, engine: EventDrivenEngine): void {.base.} =
|
||||
quit "unimplemented"
|
||||
|
||||
export Schedulable
|
||||
export Schedulable
|
||||
|
|
|
@ -11,4 +11,4 @@ type
|
|||
current_time*: uint64
|
||||
queue*: HeapQueue[Schedulable]
|
||||
|
||||
export heapqueue
|
||||
export heapqueue
|
||||
|
|
|
@ -24,7 +24,7 @@ suite "event driven engine tests":
|
|||
let engine = EventDrivenEngine()
|
||||
|
||||
engine.scheduleAll(schedulables)
|
||||
|
||||
|
||||
for time in times.sorted:
|
||||
let result = engine.nextStep().get()
|
||||
check(result.time == time)
|
||||
|
@ -33,7 +33,3 @@ suite "event driven engine tests":
|
|||
|
||||
for schedulable in schedulables:
|
||||
check(schedulable.scheduledAt == schedulable.time)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue