This commit is contained in:
2020-02-13 22:00:59 +01:00
commit 9f6d989657
12 changed files with 442 additions and 0 deletions

18
tests/testDetection.nim Normal file
View File

@@ -0,0 +1,18 @@
import unittest, os
import lamv
suite "Test the file detection":
setup:
const root = "./example"
test "Directory does not exist":
expect(OSError):
discard scanDir("./ThisDirDoesNotExist")
test "Find org files":
let files = scanDir(root)
var parts: tuple[dir, name, ext: string]
check files.len > 1
for file in files:
parts = splitFile(file)
check parts.ext == ".org"